Hi, i am new to ARDUINO and i bought Arduino Mega 2650, The short story of what I am trying to do is making TASKS with keypad as the following sequence :
if i Press >> "1" , "2" , "#" >> first Led ON,
if i Press >> "1" , "3" , "#" >> second Led ON,
if i Press >> "1" , "4" , "#" >> Third Led ON,
and so on.
Do you plan to press all 3 keys at the same time, or one after the other. These options will need different approaches to the coding.
I will assume you intend to press the keys one after the other.
You need to have some way to know when a key press sequence starts and ends. Pressing the # key might signify the end (and hence the start of a new sequence) but what happens if someone only presses one or two keys and then goes away. A long gap might be another signal for an end/start of a sequence.
Once your code knows when a sequence is starting it needs to record the keys that are pressed until there is a # key or a timeout. The simplest way would probably be to save them into successive elements of an array. If a complete sequence is received you would then need a piece of code that decides what action to take.