|
6 | 6 |
|
7 | 7 | All the variables you may need access to are marked extern in this file for easy |
8 | 8 | use elsewhere. |
9 | | -*/ |
| 9 | + */ |
10 | 10 |
|
11 | | -#include <Arduino.h> |
12 | 11 | #include <tcMenu.h> |
13 | 12 | #include "unoSsd1306Ascii_menu.h" |
14 | 13 |
|
15 | 14 | // Global variable declarations |
16 | 15 |
|
17 | | -const PROGMEM ConnectorLocalInfo applicationInfo = { "Uno1306Ascii", "c4858c2f-4134-4597-a7a0-b6719631a99b" }; |
| 16 | +const PROGMEM ConnectorLocalInfo applicationInfo = { "Uno1306Ascii", "c4858c2f-4134-4597-a7a0-b6719631a99b" }; |
18 | 17 | SSD1306AsciiRenderer renderer(20, Arial14, System5x7); |
19 | 18 |
|
20 | 19 | // Global Menu Item declarations |
21 | 20 |
|
22 | 21 | ListRuntimeMenuItem menuListItem(11, 10, fnListItemRtCall, NULL); |
23 | | -const AnalogMenuInfo PROGMEM minfoStatusTemprature = { "Temprature", 9, 0xFFFF, 255, NO_CALLBACK, -40, 2, "C" }; |
| 22 | +const PROGMEM AnalogMenuInfo minfoStatusTemprature = { "Temprature", 9, 0xffff, 255, NO_CALLBACK, -40, 2, "C" }; |
24 | 23 | AnalogMenuItem menuStatusTemprature(&minfoStatusTemprature, 0, NULL); |
25 | | -const FloatMenuInfo PROGMEM minfoStatusVoltageIn = { "Voltage In", 8, 0xFFFF, 0, NO_CALLBACK }; |
| 24 | +const PROGMEM FloatMenuInfo minfoStatusVoltageIn = { "Voltage In", 8, 0xffff, 0, NO_CALLBACK }; |
26 | 25 | FloatMenuItem menuStatusVoltageIn(&minfoStatusVoltageIn, &menuStatusTemprature); |
27 | | -const FloatMenuInfo PROGMEM minfoStatusPowerUse = { "Power Use", 7, 0xFFFF, 2, NO_CALLBACK }; |
| 26 | +const PROGMEM FloatMenuInfo minfoStatusPowerUse = { "Power Use", 7, 0xffff, 2, NO_CALLBACK }; |
28 | 27 | FloatMenuItem menuStatusPowerUse(&minfoStatusPowerUse, &menuStatusVoltageIn); |
29 | | -const SubMenuInfo PROGMEM minfoStatus = { "Status", 6, 0xFFFF, 0, NO_CALLBACK }; |
30 | 28 | RENDERING_CALLBACK_NAME_INVOKE(fnStatusRtCall, backSubItemRenderFn, "Status", -1, NO_CALLBACK) |
| 29 | +const PROGMEM SubMenuInfo minfoStatus = { "Status", 6, 0xffff, 0, NO_CALLBACK }; |
31 | 30 | BackMenuItem menuBackStatus(fnStatusRtCall, &menuStatusPowerUse); |
32 | 31 | SubMenuItem menuStatus(&minfoStatus, &menuBackStatus, &menuListItem); |
33 | | -const AnyMenuInfo PROGMEM minfoPressMe = { "Press me", 10, 0xFFFF, 0, onActionPressed }; |
| 32 | +const PROGMEM AnyMenuInfo minfoPressMe = { "Press me", 10, 0xffff, 0, onActionPressed }; |
34 | 33 | ActionMenuItem menuPressMe(&minfoPressMe, &menuStatus); |
35 | | -const BooleanMenuInfo PROGMEM minfoStandby = { "Standby", 5, 10, 1, NO_CALLBACK, NAMING_YES_NO }; |
| 34 | +const PROGMEM BooleanMenuInfo minfoStandby = { "Standby", 5, 10, 1, NO_CALLBACK, NAMING_YES_NO }; |
36 | 35 | BooleanMenuItem menuStandby(&minfoStandby, false, &menuPressMe); |
37 | | -const AnalogMenuInfo PROGMEM minfoBlue = { "Blue", 4, 8, 100, NO_CALLBACK, 0, 1, "%" }; |
| 36 | +const PROGMEM AnalogMenuInfo minfoBlue = { "Blue", 4, 8, 100, NO_CALLBACK, 0, 1, "%" }; |
38 | 37 | AnalogMenuItem menuBlue(&minfoBlue, 0, &menuStandby); |
39 | | -const AnalogMenuInfo PROGMEM minfoGreen = { "Green", 3, 6, 100, NO_CALLBACK, 0, 1, "%" }; |
| 38 | +const PROGMEM AnalogMenuInfo minfoGreen = { "Green", 3, 6, 100, NO_CALLBACK, 0, 1, "%" }; |
40 | 39 | AnalogMenuItem menuGreen(&minfoGreen, 0, &menuBlue); |
41 | | -const AnalogMenuInfo PROGMEM minfoRed = { "Red", 2, 4, 100, NO_CALLBACK, 0, 1, "%" }; |
| 40 | +const PROGMEM AnalogMenuInfo minfoRed = { "Red", 2, 4, 100, NO_CALLBACK, 0, 1, "%" }; |
42 | 41 | AnalogMenuItem menuRed(&minfoRed, 0, &menuGreen); |
43 | | -const AnalogMenuInfo PROGMEM minfoBrightness = { "Brightness", 1, 2, 100, NO_CALLBACK, 0, 1, "%" }; |
| 42 | +const PROGMEM AnalogMenuInfo minfoBrightness = { "Brightness", 1, 2, 100, NO_CALLBACK, 0, 1, "%" }; |
44 | 43 | AnalogMenuItem menuBrightness(&minfoBrightness, 0, &menuRed); |
45 | 44 |
|
46 | | - |
47 | 45 | // Set up code |
48 | 46 |
|
49 | 47 | void setupMenu() { |
50 | | - menuStatusPowerUse.setReadOnly(true); |
51 | | - menuStatusVoltageIn.setReadOnly(true); |
52 | 48 | menuStatusTemprature.setReadOnly(true); |
| 49 | + menuStatusVoltageIn.setReadOnly(true); |
| 50 | + menuStatusPowerUse.setReadOnly(true); |
53 | 51 |
|
54 | 52 | renderer.setGraphicsDevice(&gfx); |
55 | 53 | pinMode(A0, INPUT); |
56 | 54 | switches.initialise(inputFromDfRobotShield(), false); |
57 | 55 | menuMgr.initForUpDownOk(&renderer, &menuBrightness, DF_KEY_DOWN, DF_KEY_UP, DF_KEY_SELECT); |
| 56 | + menuMgr.setBackButton(DF_KEY_LEFT); |
| 57 | + menuMgr.setNextButton(DF_KEY_RIGHT); |
58 | 58 | } |
| 59 | + |
0 commit comments