Expanding from my original problem with thermocouples, I have managed to program and get each individual component to work on Mega 2560 as an individual component only i.e.
- Switch (pushbutton) with dual LEDs
- LCD Shield
- K-type thermocouple
The problem comes when I put everything together.
What I am trying to do:
- Starts off with a “main screen” with date and time and a static message
- When press and hold ‘SELECT’ button for LCD shield, it enters Menu mode to change settings, etc. and then when press and hold ‘SELECT’ again, it returns to main screen
- The switch is separate from the menu and when the button is pushed and held for 5 seconds, the red light comes on, after x secs, it changes green and then turns off (buzzer incorporated)
- Thermocouple keeps reading the temperature
- All this working in parallel (kind of) i.e. i don’t time or temp to stop reading while switch is in operation
The problems I am having:
- I can’t use the LCD buttons to navigate because I believe they might be clashing with other variables/definitions which I can’t figure out
- The switch goes red/green without pressing anything?!
- When I use the switch, everything else stops?! (i know it’s a single core board but there must be some way around it) I have already tried MILLIS tutorial but that doesn’t work
Advise and help is much needed and appreciated. Coding is not my strength, I have just started learning it.
mark18_20180312.ino (15.2 KB)