Basically, I'm a 6th grader trying to make a project using RFID and I can't code anything useable. Anyone care to help? I'd like to code my rfid toalso use a timer, and once that timer hits zero, and the rfid hasn't been used yet, it will control pin 13 to positive/blink. I have the timer code done, hopefully some of you guys would like to help? Timer code down there.
int timer=0;
bool state=0;
void setup() {
pinMode(13,OUTPUT);
TCCR0A=(1<<WGM01); //Set the CTC mode
OCR0A=0xF9; //Value for ORC0A for 1ms
TIMSK0|=(1<<OCIE0A); //Set the interrupt request
sei(); //Enable interrupt
TCCR0B|=(1<<CS01); //Set the prescale 1/64 clock
TCCR0B|=(1<<CS00);
}
void loop() {
//in this way you can count 1 second because the interrupt request is each 1ms
if(timer>=1000){
state=!state;
timer=0;
}
digitalWrite(13,state);
}
ISR(TIMER0_COMPA_vect){ //This is the interrupt request
timer++;
}
1, I'm using the Arduino uno, but I also have a backup ESP8266
2,3, The RFID tester hasn't been tested, will try later and update
4, The timer code isn't perfected, will use millis()
UPDATE
Tried to test the code, my library isn't working for some reason (was using the Addicore_RFID_example to test, as well as the AddicoreRFID-master library), debugging now.
I have found there are RFID modules with different IDs - the File>Examples>RFID_MFRC522v2>CheckFirmware program sometimes gives "Result: OK" sometimes "Result: DEFECT or UNKNOWN"
however, In general I then found that the File>Examples>RFID_MFRC522v2>ReadUidMultiReader program still works OK
I get this error message (�Reader 1: = (unknown)
WAoperly connected?
is the MFRC522 properly connected?
Reader 2: = (unknown)
WARNING: Communication failure, is the MFRC522 properly connected?
y���ڈy8) when I try the ReadUidMultiReader code. My wiring is correct,
(SDA-digital 10, SCK-digital 13, MOSI-digital 11, MISO-digital 12, IRQ not connected, GND-GND, RST-digital 9, 3.3v-3.3v) anyone know why?
wrong or no knowledge how breadboards are connected internally
many
many
more
So best thing is that you provide with more informations
post a picture of your real hardware. No online-links or online pictures
These pictures shall show how you have things wired together
The picture shall be taken from vertically above to make it easy to see what is connected to what.
Post a NOT-frizzy-picture of a hand-drawn schematic
Here are a few pictures that explain how to do it and how to not do it