button not working

TomGeorge:
Hi,
How have you got your button wired?
If it is between pin 10 and 5V, do you have a pull down 10K resistor between pin 10 and gnd?

Tom.. :slight_smile:

DVDdoug:

const int led4 = 6;

...if ((buttonstate == HIGH) && (digitalRead(led4 == HIGH)))




**P.S.**
**Your "timing" probably won't work the way you expect** because you can't read the button during the delay times. You'll only read the button at the beginning, and then after the delays, then again after the 2nd group of delays when it loops-around again. 

You'll need to use the millis() technique from the Blink Without Delay Example so you can loop quickly (without delays) to read switch more often while checking millis() every-time through your quick-loop.

I know about the timing problem i stil going to change it.
And yes i have the resistor.

thx for the reply