Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michal Rybka
openCanSat-2.0-library
Commits
22ddf4a7
Commit
22ddf4a7
authored
Sep 25, 2018
by
Markéta Jedličková
Browse files
Button funkcionality improvement
parent
c29bca77
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/2-PRO-version-examples/baseStationPRO/baseStationPRO.ino
View file @
22ddf4a7
...
...
@@ -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
(
button
2
==
LOW
and
screenNum
!=
1
)
if
(
button
1
==
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!
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment