#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int r=13,g=12,y=11,b=10;
int bu=5;
int count=0;
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
lcd.backlight();
for(int i=10;i<=13;i++)
{
pinMode(i, OUTPUT);
}
pinMode(bu, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(bu)==HIGH)
{
count++;
}
if(count==-1 || count==5)
{
count=0;
}
if(count==1)
{
lcd.clear();
digitalWrite(g, LOW);
digitalWrite(r, HIGH);
lcd.setCursor(0,0);
lcd.print("STOP");
}
else if(count==2)
{
lcd.clear();
digitalWrite(r, LOW);
digitalWrite(b, HIGH);
lcd.setCursor(0,0);
lcd.print("PADESTRING GO");
}
else if(count==3)
{
lcd.clear();
digitalWrite(b, LOW);
digitalWrite(y, HIGH);
lcd.setCursor(0,0);
lcd.print("READY");
}
else if(count==4)
{
lcd.clear();
digitalWrite(y, LOW);
digitalWrite(g, HIGH);
lcd.setCursor(0,0);
lcd.print("GO");
}
delay(200);
}