Hello,
I am trying to use my Arduino UNO (R3) to process through a menu function and then do the appropriate actions as selected by the user with simple toggle buttons. A picture of my setup will be included to further understand the design. The Uno module is connected to an LCD display and receives inputs from four buttons wired correctly with pull-up resistors and such. Everything within the system works except for when I try to run additional actions withing the selected menu option ‘Temperature’.
I originally started with simple actions such as lcd.print(“Temperature!”) when you enter the temperature sub-menu and now have moved onto actually reading in a temperature from a 16 bit ADC device. I have designed a function to do this for me and tested everything and it works as it should for reading temperature (separately). For some strange reason when I add to the sub-menu of temperature to actually read in a value, the Uno will not autonomously respond until the right button is depressed. There is no condition anywhere in the code at this code block for such a condition and yet only the right button,not the left or any other button. If I just enter the sub-menu Temperature without pressing any further buttons, just “Temperature!” shows up until the right button (BRight) is depressed.
I will include both my current code and my abbreviated code which can be run and exhibits the same problem at a smaller footprint knowing that other functions are not necessary for this problem. The abbreviated code has as little as necessary to run the menu function and the PC code will be the entire program though not necessary for full understanding.
As a bird’s eye view, there is the Arduino Uno (R3) in the bottom center followed by three breadboards for wiring simplicity and auxiliary functions. Pertaining to this problem, the bottom left board has a black button for the main menu function (BMenu) and the right board has three buttons: Left (BLeft), Select (BSelect), and Right (BRight) from left to right, respectively. The Arduino then outputs a phrase to notify the user of menu changes on the LCD screen. All other components are ancillary to this though are the voltage converter (top right), fan MOSFETs (top left), and 16 bit ADC (center).
I am truly confounded at this problem because the only condition for right button depression is for the menu to cycle through its options. I am wondering if the Arduino is overloaded with functions/variables or are libraries conflicting with each other?
Thank you for any help you may provide!
PC_abbreviated.ino (3.33 KB)
PC.ino (1.19 KB)