Question on Arrays and integration

To get straight to the question, just skip the next section please, thanks.

I have successfully finished my first Arduino project, making a setup for opening my bedroom door using a button outside the door and 2 buttons inside for lock and use. The last component I used was a hobby servo I bought at a local hobby shop. I actually took off my door handle and was left with the little square hole inside some assembly that actually pulls the latch in.

Anywho, I just received a Parallax RFID reader with 2 transmitters and was hoping to just make the setup work with 1 button on the inside and just the RFID reader on the outside. I am cool with just adding the known tag code in the program, but I want to be a bit fancier and make it so I can add more tags into it with the master tag, as well as removing known tags. I imagine this to be done with an array, but I don't quite understand how one would go about doing this. [ The fact that you start with an array in the code that is modified and changed while not attached to my computer xD ] If anyone could point me in the right direction or maybe even provide a little example code, I would be GREATLY appreciative.

To do it dynamically you will need:

  1. a "load" function to load all valid RFID #s into an array or similar
  2. a "checkIfValid" function to go through the array, comparing each entry with the most recent RFID # received to confirm it is in fact valid
  3. a "remove" function to remove an RFID# from the array
  4. a "save" function to save the RFID #s back into .... non-volatile memory (ie EEPROM)

You code is burnt into the flash. Your dynamic data can be saved in an EEPROM. It could also be saved onto an SD card. Function #1 therefore needs to load the valid RFIDs from EEPROM.

There are 2 further functions required: 5. nominate master RFID(s) - could be statically compiled into your code 6. nominate new, valid RFID(s)

These will actually need the most thought / work, as you will need to go into "add valid" mode, and then return to "normal" mode to get it to work.

No code, not even psuedo code, but I hope that helps.

I have no clue how to save things into the EEPROM at all, and honestly don't know what exactly it is quite yet. xD I was also planning on making the one static ID in the code as you mentioned, since I do have a world tag I was planning on using for that matter. I know how to make the elementary code and such, but it's like you said, these parts, that make me wonder how I will go about doing it since I do not know how to save the data. I know how to go through the array to check for a matching ID, but it confuses me on how I would go about making it add a new ID since I have the notion in my head that a defined index for an array can not be altered. And I also know how I would go about removing an existing index in the array since that is just like checking for an existing code, but using the timed index to a delete function. Guess I will check around for examples on this EEPROM thing. I have since checked up on the EEPROM, and it is actually quite simple now that I understand it's library within the Arduino IDE. http://www.youtube.com/watch?v=jQoqpDTtIx4