I built a circuit for work to address a test suite that the lab techs here have to perform as part of a product evaluation.
The current design uses 5 DPDT switches and 1 4-position rotary switch. I want to replace all of these switches with DPDT relays and give the techs a nice LCD screen with a touchscreen on top so that they can navigate through a menu system to select the test they want to perform. Once they select the proper test, the Arduino will pull the correct relays and set the circuit up for that test sequence.
So, here is the menu I want to create:
If they select the "2-Wire" option, then:
Tip Ring Tip/Ring
If they selected the "4-Wire" option, then:
Tip Ring Tip1 Ring1 Tip/Ring Tip1/Ring1
I'm pretty sure I can do this with a switch structure, but I have a couple of questions regarding the LCD and Touchscreen combination.
I bought these:
And, I read this information:
and this topic regarding this LCD and the above mentioned code found here:
From what I gathered, it seems that the LCD Library should work with this LCD.
I have not worked with LCDs or Touchscreens, but I think I have the basic idea here.
This is what I want to do:
The touchscreen is basically a set of invisible buttons that are laid over the LCD. When a person touches a particular location of the touchscreen, the program interprets that as a button press and it executes the routine associated with that button press. To the user, it appears that they are actually pushing the pseudobutton on the LCD.
So, as the user navigates through the various submenus, the information displayed on the LCD will obviously change, and if they need the ability to select options on those submenu screens, then the touchscreen "buttons" will have to change position accordingly, right?
So, here are my questions:
Will all anticipated softbuttons on the touchscreen have to be defined seperately, or can you reuse certain button definitions in more than one routine?
Can the code for the touchscreen and the LCD be contained in the same routine, or would it be better to separate them into two different functions so that the touchscreen inputs change the LCD outputs and relocates the touchscreen softbuttons?
I will be prototyping with a Mega, and then converting it over to a smaller Arduino once I have it working (possibly a Nano, or similar). Is there any issues with doing this?
NOTE: This will be a permanent install, so it does not matter if I use all of the pins or not. I would, however, like to utilize as many pins as possible to justify the expense.