Old to new

Just a quick one google won’t help me with
Will a program written for the ATmega168 with Arduino Bootloader run on an Arduino Uno Rev 3 with the ATmega328 microcontroller

Updated Code - Now in a readable format.txt (23.4 KB)

Probably. I tried to look at your code but it is completely unformatted and all jammed up against the left margin so it was a bit hard to read and I stopped.

Sorry saved it from instructables, but have now just copied and pasted and is now readable
Sorry

It's still all jammed up against the left margin. Open it up in the IDE, hit control-T to autoformat, and then save it and post the .ino file instead of as text.

From what I can see it looks like everything would be OK. The only concern is that if it is that old it may be written for a much older version of the Arduino IDE and there may be some weird errors that pop out from that. The best way to tell would be to open it up in the IDE and try to compile it and see what happens. Post up the errors you get here if you don't understand them.

(deleted)

(deleted)

Thank you so much
Do I also need to change the lines of code further down with EEPROM.h
eg.

From - storedCard = EEPROM.read(start+i); // Assign values read from EEPROM to array

To - storedCard = EEPROM.h.read(start+i); // Assign values read from EEPROM to array
Also should I be worried about the message -
C:\Users\Brad\Desktop\Arduino RFID\Code\RFID_Door_Access\RFID_Door_Access.ino:405:14: warning: NULL used in arithmetic [-Wpointer-arith]
if ( a[0] != NULL ) // Make sure there is something in the array first
That comes before the
Sketch uses 4762 bytes (14%) of program storage space. Maximum is 32256 bytes.
Global variables use 247 bytes (12%) of dynamic memory, leaving 1801 bytes for local variables. Maximum is 2048 bytes.
Sorry if this seems basic, just learning and wanted to impress the old man when they visit
Thanks again

You don't need to worry about that warning, but you can replace the NULL with 0 and it will not throw the warning anymore.