Void Screen2 is a LCD menu which has 2 lines
1/ Timers SetUp
2/ Clock SetUp
In my first part of the loop I have called Screen2 by means of pushing button BtnE. The second part of my sketch will be "if you are presently in Screen2 (ie my initial idea of using a Boolean) I need to either press button x to go to Timers or button y to go to Clock.
boolean is a data type. You assign values to variables of some type.
Since you don't have a variable, you can, obviously, never reference the variable in the function, so it doesn't make sense to even have the argument with a default value.
enum ScreenState{
MAIN_SCREEN,
SCREEN_ONE,
SCREEN_TWO
};
ScreenState screenState = MAIN_SCREEN;
bool buttonPressed; //just to compile example
void setup()
{
// put your setup code here, to run once:
}
void loop()
{
switch (screenState)
{
case MAIN_SCREEN:
//do main screen stuff
break;
case SCREEN_ONE:
// do screen one stuff
break;
case SCREEN_TWO:
//do screen two stuff
break;
}
if (buttonPressed && screenState == MAIN_SCREEN)
{
screenState = SCREEN_ONE;
}
}