Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.
Sorry this is the hole Error:
C:\Users\folkm\AppData\Local\Temp.arduinoIDE-unsaved202302-11368-pgspe0.64ukf\sketch_jan2a\sketch_jan2a.ino: In function 'void loop()':
C:\Users\folkm\AppData\Local\Temp.arduinoIDE-unsaved202302-11368-pgspe0.64ukf\sketch_jan2a\sketch_jan2a.ino:7:13: error: expected primary-expression before '{' token #define UID {0xDE, 0xAD, 0xBE, 0xEF}
^
C:\Users\folkm\AppData\Local\Temp.arduinoIDE-unsaved202302-11368-pgspe0.64ukf\sketch_jan2a\sketch_jan2a.ino:19:38: note: in expansion of macro 'UID'
if (mfrc522.PICC_ReadCardSerial()==UID) {
^~~
C:\Users\folkm\AppData\Local\Temp.arduinoIDE-unsaved202302-11368-pgspe0.64ukf\sketch_jan2a\sketch_jan2a.ino:7:13: error: expected ')' before '{' token #define UID {0xDE, 0xAD, 0xBE, 0xEF}
^
C:\Users\folkm\AppData\Local\Temp.arduinoIDE-unsaved202302-11368-pgspe0.64ukf\sketch_jan2a\sketch_jan2a.ino:19:38: note: in expansion of macro 'UID'
if (mfrc522.PICC_ReadCardSerial()==UID) {
^~~
Mehrere Bibliotheken wurden für "LiquidCrystal.h" gefunden
Benutzt: C:\Users\folkm\OneDrive\Dokumente\Arduino\libraries\LiquidCrystal
Nicht benutzt: C:\Users\folkm\AppData\Local\Arduino15\libraries\LiquidCrystal
exit status 1
Compilation error: expected primary-expression before '{' token
Hi @lukegaming911 ,
welcome to the Arduino-Forum.
Well done posting code as a code-section.
As you have encountered with your project changing too many things at the same time with knowing too less about programming leads to errors.
The compiler-error-messages point to where the error occured
7:13 means line 7 columm 13 inside file sketch_jan2a.ino
caused the error.
There are things to learn:
Save your sketch with a meaningful and self-explaining name.
read-RFID-LCD-001.ino or something like that
Each time you have reached a party working state of your code save the code again with a new
serial number
read-RFID-LCD-002.ino
read-RFID-LCD-003.ino
...
Start from a code that is well known as working and then do a small modification towards your aims. Test the code again if the code works as expected with the small modification.
If the code works as exepcted do another small modification.
That is an initializer list, not a valid array. Try: const byte UID[] = {0xDE, 0xAD, 0xBE, 0xEF};
You can't directly compare two arrays like that. If the arrays are null terminated character strings you would use 'strcmp()' but since they aren't, you have to specify the number of bytes of memory to compare:
if (memcmp(mfrc522.PICC_ReadCardSerial(), UID, 4) == 0))