StefanL38:
Hi efl,you still seem not to understand what the point is:
If you stay on that low level of understanding. You will have to beg for every single line of code to be pre-written for you so you can copy and paste it.
If this is your very first project it is three levels too difficult.
Imho there is no short-path to a solution. Except you find a code that does fit 101% to your needs.The best way would be to work through a tutorial with basic examples.
fifth best way to understand what the code does is adding serial debug-output to a code to see what the code is doing.
This will give you hints for asking concrete questions.So here is the RFID-demo-code with added debug-output.
I have changed baudrate to 115200 to make the serial output faster.
You have to change the baudrate in the serial monitor to this value.Load this code into your board open the serial monitor and watch what is running through the serial monitor.
I insist on that you have to ask a questions about everything that is unclear to you.
Because this means I would have work for weeks. Whatever questions come up ask them.You still seem to hope that someone will write down all you need to get it working.
If this happends big congratulations.With the attitude you have shown so far I refuse to give an all inclusive tutorial about everything. And I will not develop the code for you.
So as soon as you start asking concrete questions about whatever I will answer them. That's my way of giving support in this forum.
here is the code with the serial output
#include <deprecated.h>
#include <MFRC522.h>
#include <MFRC522Extended.h>
#include <require_cpp11.h>
#include <SPI.h>
#define RST_PIN 5 // Configurable, see typical pin layout above
#define SS_PIN 53 // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
unsigned long UID[3];
unsigned long UID1;
void setup() {
Serial.begin(115200);
SPI.begin();
}
void loop() {
if (!mfrc522.PICC_IsNewCardPresent()) {
Serial.println("if (!mfrc522.PICC_IsNewCardPresent()) return will be executed");
return;
}
if (!mfrc522.PICC_ReadCardSerial()) {
Serial.println("if (!mfrc522.PICC_ReadCardSerial()) return will be executed");
return ;
}
Serial.println("right before for (int i = 0; i < 3; i++) {");
for (int i = 0; i < 3; i++) {
UID[i] = mfrc522.uid.uidByte[i];
Serial.print(UID[i], HEX);
Serial.print(UID[1], HEX);
}
Serial.println("right behind for (int i = 0; i < 3; i++) {");
}
best regards Stefan
I am not asking and do not want anyone to write the code for me this is not my intent i have been trying to work on this code a lot recently i feel like i have a way better understanding of this type of programming now im still not great but im getting better. ive been doing all this while ive been on vacation so i have not been able to test it because my board is home but i will keep you posted on what i have when i get back home if i have any questions. Thanks