Hi all
I'am new to this :astonished:
I am hoping that someone can help me.
I have got hold of a Arduino uno r3 dev board, and i'am wanting to make 1 button input to switch 4
different outputs high, and display on a JM164A 16x4 lcd (line1=mic1,line2=mic2,line3=line1,line4=line2) each button press selects the next output in a loop.
I have been looking all over the net trying to find any examples, but not found any =(
You need to look at the button and when it changes from being pressed to not being pressed you increment a counter, and do the following:-
Delay for 25mS for suppressing contact bounce.
Then look at the counter and if it exceeds the maximum value, which in your case is 3 you put it back to zero.
Then you have a switch statement that puts out the appropriate message and set the appropriate bits high while setting the other bits low.
The last thing in the loop is you save the current state of the button in a variable so you can test against it the next time round the loop.