Mashinasozlik ishlab chiqishni avtomatlashtirish


printDec(rfid.uid.uidByte, rfid.uid.size)



Download 9,72 Mb.
bet25/28
Sana23.07.2022
Hajmi9,72 Mb.
#841887
1   ...   20   21   22   23   24   25   26   27   28
Bog'liq
Dissertatsiya 29.06.2022

printDec(rfid.uid.uidByte, rfid.uid.size);
Serial.println();
}
else Serial.println(F("Card read previously."));
// PICC to’xtatish
rfid.PICC_HaltA();
// shifrlashni to’xtatish
rfid.PCD_StopCrypto1();
}
/**
* Helper routine to dump a byte array as hex values to Serial.
*/
void printHex(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], HEX);
}
}
/**
* Helper routine to dump a byte array as dec values to Serial.
*/
void printDec(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], DEC);
RFID hamda NODEMCU qurilmalari orqali kitobxonni ro’yhatga olish:
#include
#include
#include
#include
MFRC522 mfrc522(D4, D3);
OLED display(D2, D1);


char* ssid = "Shaheer and Sadeem";
char* password = "alpha222";
WiFiClient c;
WiFiServer server(23);


String getUID(byte *buffer, byte bufferSize) {
String id = "";
for (byte i = 0; i < bufferSize; i++) {
id.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? "0" : ""));
id.concat(String(mfrc522.uid.uidByte[i], HEX));
}
return id;
}


char *status;
char buf[10];
char recv[20];
bool disp = true;


void setup() {


display.begin();
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522


display.print("Connecting to ");
display.print(ssid,2);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
int i = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
display.print(".",4,i++);
if(i > 8) i = 0;
}
display.print("WiFi connected",7);
server.begin();
server.setNoDelay(true);
delay(1000);


}


void loop() {
if (server.hasClient()) {
if (!c || !c.connected()) {
if (c) c.stop();
c = server.available();
//Serial.print("New client");
}
}
if (c && c.connected())
{
status = "ONLINE ";
if (disp == false)
{
display.begin();
display.print(status, 0);
disp = true;
}
mfrc522.PCD_Init();
if (mfrc522.PICC_IsNewCardPresent())
if (mfrc522.PICC_ReadCardSerial()) {
String x = getUID(mfrc522.uid.uidByte, mfrc522.uid.size);
x.toUpperCase();
x.toCharArray(buf, x.length());
//Serial.println(buf);
c.println(buf);
delay(1);
c.flush();
}
if (c.available()) {
String r = c.readStringUntil('\n');
r.toUpperCase();
r.toCharArray(recv, r.length());
//Serial.println(recv);
display.begin();
display.print(status, 0);
display.print(recv, 2);
if(r.charAt(r.length()-1) == 'M')
display.print("MARKED", 4);
if(r.charAt(r.length()-1) == 'A')

Download 9,72 Mb.

Do'stlaringiz bilan baham:
1   ...   20   21   22   23   24   25   26   27   28




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish