Help - a challenge for a newbie

Hi,

I am trying to record the sequence in which a switch is pressed over a second or so, then play this back in a loop.

So from when the switched is first pressed it will store variables like this, "1001111000011111000011111" depending on how it is pressed.

Then I can replay these stored variables to an LED afterwards and it will blink in the sequence in which the switch was pressed.

Does this make sense and is it possible. I have been trying with an array of variables, to store the state of the switch but am having no luck because I am used to basic and still getting used to Arduino.

Does anyone have any suggestions of a simple solution? Or has anyone done something similar.

Thanks.

One way is to sample and save the switch state at various intervals. It looks like this is what you are thinking. If the only information you want is if a switch was pressed (at least once) in a given second over some period of time then its relatively easy to do. Is that what you want?

Perhaps you can say what use you will have for your project.

I have been trying with an array of variables, to store the state of the switch but am having no luck because I am used to basic

It really isn't that different to how you'd do it in BASIC (simply record the time each time you see the button pressed) - you're still going to use arrays.
What you don't say is what marks the end of the button-pressing phase and the start of the replay phase.