button not working

Hi,

const int button = 7;
const int ledg = 0;
const int ledr = 1;
const int led1 = 2;
const int led2 = 3;
const int led3 = 4;
const int led4 = 5;
const int led5 = 6;

To help make your code readable this may help;

const int buttonPin = 7;
const int ledgPin = 0;
const int ledrPin = 1;
const int led1Pin = 2;
const int led2Pin = 3;
const int led3Pin = 4;
const int led4Pin = 5;
const int led5Pin = 6;

In the IDE look for Files, Examples, Digital, Blink Without Delay.
It will give you an example of using millis() to create a delay.

Tom.... :slight_smile: