Hi,
ich habe mir für ein Arduino Projekt mit einem RFID Scanner einen Sketch aus dem Internet geholt. Dieser funktioniert zwar, allerdings verstehe ich einen Teil vom Sketch nicht. Ich würde mir freuen, wenn das jemand erklären könnte. Die Stellen im Sketch habe ich markiert.
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal_I2C.h> // Using version 1.2.1
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
MFRC522 mfrc522(10, 9);
void setup()
{
Serial.begin(9600);
SPI.begin();
mfrc522.PCD_Init();
lcd.begin(16, 2); // sixteen characters across - 2 lines
lcd.backlight();
}
void loop()
{
//here we have to wait for the card, when it is near to the sensor
if ( ! mfrc522.PICC_IsNewCardPresent()){
return;
}
//we can read it's value
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
Serial.print("Tag:"); // AB HIER HABE ICH KEINE AHNUNG WAS PASSIERT
String content= "";
for (byte i = 0; i < mfrc522.uid.size; i++) {
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
content.toUpperCase();
content = content.substring(1);
if(content == "43 10 C7 D3"){
lcd.setCursor(3, 0); // AB HIER WEIß ICH WIEDER WAS PASSIERT
lcd.print("Willkommen");
delay(750);
lcd.clear();
delay(500);
}
else {
lcd.setCursor(2, 0);
lcd.print("Kein Zugriff");
delay(750);
lcd.clear();
delay(500);
}
}