1 Button 2 leds


i have the arduino now for some weeks i do my verry best to understand to program the arduino.
a code to read its not the hardest thing but if i’m trying to make a code on my own its for the next level person.
but what i’m try to do is :
if i push a button led 1 must go on
push te same button again led 1 must go off and led 1 must go on and stay on
if the butten will be pusht again led 2 must go off.

it is mayby a stupid easy quastion for some people, but i hope someone can tell me how this works.

button.ino (587 Bytes)

Have a look here

That particular example switches the LED every 4 presses, else it switches it off.

You could easily adapt it so that if count = 1 do this, count =2 do that etc etc.

thanks for your anwser, i will have a look!