I'm looking to add multiple layers to the display so that when a button is pressed it will change from displaying the information that is currently on the screen, to something else for example temperature. I am now quite confident that I can write the instructions for the display, but I am struggling to figure out how to write the program to allow me to achieve this.
I was thinking that I would need to use the following (shamelessly stolen from the learning section) to monitor how many times the button has been pressed so the arduino will know which part of the routine to run.
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
I will also include a debounce as there is likely to be some noise where this will be used on completion. Would I be right in thinking that a switch statement is the one to use to get the screen to display the information from different sensors?