LOGIC RECORDER

I am a newbie and looking for a way to record the logic state of 3 on/off switches in real time. The task is to read the switches as logic inputs, store the conditions and then ‘play’ them back as logic outputs at the same rate they were recorded. For example: press Start Recording: sw1 is closed for 1 second then open for 2 sec, Sw2 is closed for 0.5 second then open for 3 sec. Keep recoding the various switch conditions for say 3 minutes. Then press STOP Recording. Now pres PLAY and the states of the 3 switches would be sent as outputs at exactly the same rate and durations as they were recorded. It would be kind of like a data logger, but I am not interested in plotting but rather playing back the entire sequence.

Any suggestions?

laserr:
I am not interested in plotting but rather playing back the entire sequence.

Any suggestions?

How many switching actions do you want to record with which timer resolution as a sequence?

If there are only a few dozen events, you could record them to RAM and playback.

But if there are many hundreds of events, you will have to use a SD card to record them all. Also if you want to keep the recorded events while the Arduino is powered down, you'd have to save them to a SD card, or you must teach-in new data each time the Arduino reboots.

I think you can approach this in one of two ways.
EITHER record the time (using millis() ) when each event occurs as well as a byte to record the state of the switches at that moment - which requires 5 bytes for each event.
OR record the state of the buttons at regular intervals which only requires one byte per interval, but a lot of single bytes need to be recorded.

...R

jurs:
How many switching actions do you want to record with which timer resolution as a sequence?

If there are only a few dozen events, you could record them to RAM and playback.

But if there are many hundreds of events, you will have to use a SD card to record them all. Also if you want to keep the recorded events while the Arduino is powered down, you'd have to save them to a SD card, or you must teach-in new data each time the Arduino reboots.

There will be hundreds of events so SD card will be used. I will be monitoring 3 switches. Any suggested sketch I can start with?

Google datalogging.