Hi all, I have two different variables LHAP and RHAP and they are to increase by 1. When either LHAP or RHAP hit the max its to return back to the main menu. LHAP can have a range from 10-90 and is user input RHAP can have a range from 10-90 and is user input
void raisebothbags()
{
++LHAP; // Increase by 1
++RHAP; // Increase by 1
if (LHAP >= 90) // If equal or greater
{
LHAP = 90; //LHAP MAX
}
if (RHAP >= 90) // If equal or greater
{
RHAP = 90; //RHAP MAX
}
if (LHAP == 90 || RHAP == 90); //or operator. true for either, I believe the problem is here because nothing below is working
{
lcd.print("MAXIMUM HEIGHT");
delay(1000);
return; //return from where invoked from (main menu)
}
digitalWrite(LeftInflate,HIGH); // Send pin HIGH
digitalWrite(RightInflate,HIGH); // Send pin HIGH
delay(10);
digitalWrite(LeftInflate,LOW); // Send pin LOW
digitalWrite(RightInflate,LOW); // Send pin LOW
}
I have tried many different ways to get this to work but just cant see it regards crazy