Hello everyone,
i am coming out with a simple program to control the LCD screen using a button. However i tried compiling it and it gave me this error . expected ';' before '(' token and expected primary-expression before ')' token. Can someone please help me to rectify the problem?
Thanks
#include <LiquidCrystal.h>
#define selector 8
LiquidCrystal lcd(12,11,5,4,3,2);
int Menu =-1;
int Status;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(6,INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8,INPUT_PULLUP);
pinMode(10,INPUT_PULLUP);
lcd.begin(16, 2);
}
void loop()
{
// // put your main code here, to run repeatedly:
Status = digitalRead(selector);
if (Status ==0)
{
Menu++;
if (Menu ==3)
{
Menu=0;
}
switch(Menu)
{
case 0:
lcd.clear();
lcd.print("Autopilot");
break();
case 1:
lcd.clear();
lcd.print("Heading");
break();
case 2:
lcd.clear();
lcd.print("Altitude");
}
}
}