Adding on and off switches to my project

Hello, im currently working on a arduino project in which i have a LCD display counting down a timer, and i want to add two button switches. One switch to turn the LCD display on and one switch to switch the display off. i was wondering what code would i need to achieve this function.

Also i would like to add a LED that would flash after the counter has ended. i would like it to flash for 3 seconds at any interval. once again i was hoping to get some help on the coding.

thankyou in advnaced.

There is a post that asks the same thing as you: How to switch off an LCD screen (arduino.cc)

And with the case of turning on a led after the timer ends, it would be very easy, right? As you have not entered your code, I could not tell you exactly how to tell you, but something very simple that you can do is that when the timer reaches a certain number the led will turn on.

this is the code i have at the moment, i added the inputs of the switches and the led bulb, but everything else it no yet there.

#include <LiquidCrystal.h>

LiquidCrystal lcd0(1,2, 4, 5, 6, 7);

int redPin = 9;
int bluePin = 10;
int greenPin = 11;

void setup()
{
lcd0.begin(16,2);
pinMode(13, OUTPUT);

pinMode(redPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
}

int i=0,count=0;
void loop()
{
digitalWrite(bluePin, LOW);
digitalWrite(redPin, HIGH);
delay(100);
digitalWrite(redPin, LOW);

digitalWrite(greenPin, HIGH);
delay(100);
digitalWrite(greenPin, LOW);

digitalWrite(bluePin, HIGH);
delay(100);

lcd0.setCursor(0,0);
lcd0.print("excersise : ");
lcd0.print(count);

for(i=3600;i>=0;i–){
lcd0.setCursor(1,1);
lcd0.print(" ");
lcd0.setCursor(0,1);
lcd0.print(i);
delay(1000);

if(i == 0)
count++;

}

What’s on pin 8?

Please remember to use code tags when posting code

a output coming from the LED, sorry about this im new to arduino,

ive also managed to make the LED blink when the counter reaches zero by adding (digitalWrite(8, LOW);) in the IF statemenet, but i dont know how to make it blink for 30 seconds.

i have now managed to sort out the led problem, i just dont know how to porgramme my 2 buttons to turn off the display of my lcd and turn it on.

any help?

gamelon01: i have now managed to sort out the led problem, i just dont know how to porgramme my 2 buttons to turn off the display of my lcd and turn it on.

any help?

Have you looked at the pushbutton switch examples that ship with the IDE?

im doing all of this on tinker cad so no, i have the button hooked up to two pins and 2 grounds, just dont know how to porgramme them to work with the lcd

“One switch to turn the LCD display on and one switch to switch the display off”

On/Off as in power on/off?
Or Off meaning ‘a blank display’?

gamelon01: im doing all of this on tinker cad so no, i have the button hooked up to two pins and 2 grounds, just dont know how to porgramme them to work with the lcd

What about the tutorials on this site, then? Is this a school assignment?