Hi,
I am trying to use a menu system with a rotary encoder.
The idea is to select an item from the menu (by pressing the rotary encoder button) and then dial in a value for that item and then press the button again to set that value. At that point the menu should should return to the root.
Heres what's happening: I can traverse the menu, I can dial in a value (I'm just doing "Pulse Duration" for the moment) but when I click the button to set the value, it goes back to the root of the menu (as it should) and then selects the first item "Extraction" (which it shouldn't).
I have been going over this for hours and can't see where I'm going wrong.
I am doing debouncing in hardware (see attached schematic).
If I run the Arduino IDE using sudo (I realise this is a no-no), I get:
In file included from /usr/local/arduino-1.8.3/libraries/REBL_UI/REBL_UI.h:16:0,
from /home/rsatchel/Arduino/REBL_Menu_Example/REBL_Menu_Example.ino:2:
/usr/local/arduino-1.8.3/libraries/REBL_UI/REBL_Functions.h:26:18: error: variable or field 'displayTime' declared void
void displayTime(time_t aTime);
^
/usr/local/arduino-1.8.3/libraries/REBL_UI/REBL_Functions.h:26:18: error: 'time_t' was not declared in this scope
/usr/local/arduino-1.8.3/libraries/REBL_UI/REBL_Functions.h:27:19: error: 'time_t' was not declared in this scope
boolean inputTime(time_t& var);
^
/usr/local/arduino-1.8.3/libraries/REBL_UI/REBL_Functions.h:27:27: error: 'var' was not declared in this scope
boolean inputTime(time_t& var);
^
REBL_Menu_Example:19: error: 'fun1' was not declared in this scope
{ "display", fun1 } ,
^
REBL_Menu_Example:20: error: 'pressToExit' was not declared in this scope
{"press", pressToExit } ,
^
REBL_Menu_Example:21: error: 'pickNumber' was not declared in this scope
{"enter number", pickNumber } ,
^
REBL_Menu_Example:22: error: 'fourLetterWord' was not declared in this scope
{"enter string", fourLetterWord } ,
^
REBL_Menu_Example:23: error: 'enterTime' was not declared in this scope
{"set time", enterTime } ,
^
REBL_Menu_Example:24: error: 'showTime' was not declared in this scope
{"show time", showTime }
^
/home/rsatchel/Arduino/REBL_Menu_Example/REBL_Menu_Example.ino: In function 'boolean enterTime()':
REBL_Menu_Example:157: error: 'inputTime' cannot be used as a function
if (inputTime(timeSetTime)) {
^
REBL_Menu_Example:165: error: 'displayTime' was not declared in this scope
displayTime(now());
^
/home/rsatchel/Arduino/REBL_Menu_Example/REBL_Menu_Example.ino: In function 'boolean showTime()':
REBL_Menu_Example:182: error: 'displayTime' was not declared in this scope
displayTime(now()); // display the running time
^
exit status 1
'fun1' was not declared in this scope
I used the Time library that was linked to from the Arduino Playground: Time Library
Oh I guess I need to do some updating. The Time library has changed. You have to include TimeLib.h now instead of Time.h
You should change out the LCD library for whatever flavor you happen to use. Most of them will use the same set of commands so the code shouldn't have to change much.
I don't know. I'll pull down the newest IDE sometime soon and have a look at it. No time right now. If you fix it then I'd appreciate a pull request or at least a copy of what you did.
econjack:
You might also look at the TFT color displays, as they are now about the same price as a 2x16 LCD display. The display shown here is a 2.4" display
Delta_G:
Oh I guess I need to do some updating. The Time library has changed. You have to include TimeLib.h now instead of Time.h
You should change out the LCD library for whatever flavor you happen to use. Most of them will use the same set of commands so the code shouldn't have to change much.
I don't know. I'll pull down the newest IDE sometime soon and have a look at it. No time right now. If you fix it then I'd appreciate a pull request or at least a copy of what you did.