My code doesn't work.

Hi,

I wrote it to put your code on a logical track.

Do you see how checking if the LED is ON or OFF, the if statement selects the time interval.

Do you see how naming the pins like

const int GreenLEDPin = 2;

pinMode (GreenLEDPin, OUTPUT);

digitalWrite(GreenLEDPin, LOW);

Makes you code easier to follow without comments.

I am glad you have the function statements working, as your code shows it makes the reading of the void loop() easier to follow and the task easier to understand.

Tom... :slight_smile: