Commit 22ddf4a7 authored by Markéta Jedličková's avatar Markéta Jedličková
Browse files

Button funkcionality improvement

parent c29bca77
......@@ -99,45 +99,52 @@ void loop()
int button2 = digitalRead(BUTTON_2);
int button3 = digitalRead(BUTTON_3);
if(button3 == LOW and screenNum == 0)
{
screenNum = 1;
ocsDesign.drawHomescreen();
delay(300);
Serial.println("Button 3 ");
}
if(button1 == LOW and screenNum == 1)
{
screenNum = 0;
ocsDesign.drawLeftScreen();
delay(300);
Serial.println("Button 1 ");
}
if(button2 == LOW and screenNum != 1)
if(button1 == LOW)
{
screenNum = 1;
ocsDesign.drawHomescreen();
delay(300);
Serial.println("Button 2 ");
if(screenNum == 1)
{
screenNum = 0;
ocsDesign.drawLeftScreen();
delay(300);
Serial.println("Button 1 ");
}
else if(screenNum == 2)
{
screenNum = 1;
ocsDesign.drawHomescreen();
delay(300);
Serial.println("Button 1 ");
}
}
if(button3 == LOW and screenNum == 1)
else if(button2 == LOW)
{
screenNum = 2;
ocsDesign.drawRightScreen();
delay(300);
Serial.println("Button 3 ");
if(screenNum != 1)
{
screenNum = 1;
ocsDesign.drawHomescreen();
delay(300);
Serial.println("Button 2 ");
}
}
if(button1 == LOW and screenNum == 2)
else if(button3 == LOW)
{
screenNum = 1;
ocsDesign.drawHomescreen();
delay(300);
Serial.println("Button 1 ");
}
if(screenNum == 1)
{
screenNum = 2;
ocsDesign.drawRightScreen();
delay(300);
Serial.println("Button 3 ");
}
else if(screenNum == 0)
{
screenNum = 1;
ocsDesign.drawHomescreen();
delay(300);
Serial.println("Button 3 ");
}
}
if (radio.receiveDone()) // Got one!
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment