Hi, I wonder if anyone could point me in the right direction as I'm a little confused.
I come from a .NET programming environment where if one wants to get user input it usually comes in the form of an event, say a button click event.
Also, if something needs doing in a loop independently of driving the gui (say a timed data log), it can be done on a separate thread or by using a timer.
So, coming from an event driven environment I am having issues with the Arduino.
I'm in the throws of designing a sketch that controls an environment.
I'd like to have either some hardware buttons or a touch screen to allow the user to alter variables for temperature threshold etc.
If my main sketch loop is looping, reading the sensors then setting the outputs, do I need to put code in that loop to poll for button inputs in order to determine how to draw the LCD?
I am currently using a 16x2 Keypad LCD shield. Using this shield I'd like to enable the user to scroll a vertical menu system, select a variable to change then use the left and right buttons to change it. Like this :
Obviously my 2 row LCD can only show 2 rows at a time and so is it good idea to assign each value in the list ablove to an integer value which the sketch can track so that when the user clicks the select button it knows what they want to edit?
I'm struggling really with design concepts regarding gui interface design and basic user input standard practice. If anybody knows a good tutorial I could read that would be awesome, till now, I can't find anything that is anywhere near comprehensive regarding this.
I guess I could hack something out but I fear I'd be re-designing the wheel, time to ask the experts I think