Skip to content

Commit d8fe0a4

Browse files
committed
More examples tested and built with web IDE
1 parent 7e3eed4 commit d8fe0a4

11 files changed

Lines changed: 1384 additions & 99 deletions
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
{
2+
"version": "1.00",
3+
"projectName": "Nano R4 RGB OLED",
4+
"author": "dave",
5+
"items": [
6+
{
7+
"parentId": 0,
8+
"type": "analogItem",
9+
"defaultValue": "0",
10+
"item": {
11+
"maxValue": 255,
12+
"offset": 0,
13+
"divisor": 1,
14+
"unitName": "tms",
15+
"step": 0,
16+
"name": "Count",
17+
"variableName": "",
18+
"id": 4,
19+
"eepromAddress": -1,
20+
"functionName": "",
21+
"readOnly": true,
22+
"localOnly": false,
23+
"visible": true,
24+
"staticDataInRAM": false
25+
}
26+
},
27+
{
28+
"parentId": 0,
29+
"type": "actionMenu",
30+
"item": {
31+
"name": "Add",
32+
"variableName": "",
33+
"id": 5,
34+
"eepromAddress": -1,
35+
"functionName": "tcAdded_onAddToCount",
36+
"readOnly": false,
37+
"localOnly": false,
38+
"visible": true,
39+
"staticDataInRAM": false
40+
}
41+
}
42+
],
43+
"codeOptions": {
44+
"embeddedPlatform": "ARDUINO32",
45+
"lastDisplayUuid": "4dcb12ec-13d8-4466-b8b6-bd575eae4612",
46+
"lastInputUuid": "6dd87e7d-e751-4912-a70d-91793b1d3d87",
47+
"lastRemoteUuids": [
48+
"2c101fec-1f7d-4ff3-8d2b-992ad41e7fcb"
49+
],
50+
"lastThemeUuid": "1947F585-9D36-448C-8A80-B425686107BD",
51+
"applicationUUID": "aab5df00-3943-48ad-8edf-0112f7be8925",
52+
"applicationName": "NanoR4 RGB",
53+
"lastProperties": [
54+
{
55+
"name": "DISPLAY_SEPARATOR_DISP",
56+
"latestValue": "",
57+
"subsystem": "DISPLAY"
58+
},
59+
{
60+
"name": "DISPLAY_TYPE",
61+
"latestValue": "Adafruit_SSD1351",
62+
"subsystem": "DISPLAY"
63+
},
64+
{
65+
"name": "DISPLAY_VARIABLE",
66+
"latestValue": "display",
67+
"subsystem": "DISPLAY"
68+
},
69+
{
70+
"name": "DISPLAY_WIDTH",
71+
"latestValue": "128",
72+
"subsystem": "DISPLAY"
73+
},
74+
{
75+
"name": "DISPLAY_HEIGHT",
76+
"latestValue": "128",
77+
"subsystem": "DISPLAY"
78+
},
79+
{
80+
"name": "PINS_SEPARATOR_DISP",
81+
"latestValue": "",
82+
"subsystem": "DISPLAY"
83+
},
84+
{
85+
"name": "DISPLAY_RESET_PIN",
86+
"latestValue": "8",
87+
"subsystem": "DISPLAY"
88+
},
89+
{
90+
"name": "DISPLAY_CS_PIN",
91+
"latestValue": "10",
92+
"subsystem": "DISPLAY"
93+
},
94+
{
95+
"name": "DISPLAY_RS_PIN",
96+
"latestValue": "9",
97+
"subsystem": "DISPLAY"
98+
},
99+
{
100+
"name": "DISPLAY_DATA_PIN",
101+
"latestValue": "-1",
102+
"subsystem": "DISPLAY"
103+
},
104+
{
105+
"name": "DISPLAY_CLOCK_PIN",
106+
"latestValue": "-1",
107+
"subsystem": "DISPLAY"
108+
},
109+
{
110+
"name": "OTHER_SEPARATOR_DISP",
111+
"latestValue": "",
112+
"subsystem": "DISPLAY"
113+
},
114+
{
115+
"name": "ST7735_TAB_TYPE",
116+
"latestValue": "INITR_BLACKTAB",
117+
"subsystem": "DISPLAY"
118+
},
119+
{
120+
"name": "UPDATES_PER_SEC",
121+
"latestValue": "5",
122+
"subsystem": "DISPLAY"
123+
},
124+
{
125+
"name": "DISPLAY_ROTATION",
126+
"latestValue": "0",
127+
"subsystem": "DISPLAY"
128+
},
129+
{
130+
"name": "DISPLAY_BUFFER_SIZE",
131+
"latestValue": "40",
132+
"subsystem": "DISPLAY"
133+
},
134+
{
135+
"name": "DISPLAY_CUSTOM_SPI_NAME",
136+
"latestValue": "SPI",
137+
"subsystem": "DISPLAY"
138+
},
139+
{
140+
"name": "ITEM_FONT",
141+
"latestValue": "tca:OpenSansRegular10pt,0",
142+
"subsystem": "THEME"
143+
},
144+
{
145+
"name": "TITLE_FONT",
146+
"latestValue": "tca:OpenSansRegular10pt,0",
147+
"subsystem": "THEME"
148+
},
149+
{
150+
"name": "BORDER_FOR_ACTIONS",
151+
"latestValue": "0",
152+
"subsystem": "THEME"
153+
},
154+
{
155+
"name": "TITLE_SHOW_MODE",
156+
"latestValue": "TITLE_ALWAYS",
157+
"subsystem": "THEME"
158+
},
159+
{
160+
"name": "USE_TC_UNICODE",
161+
"latestValue": "true",
162+
"subsystem": "THEME"
163+
},
164+
{
165+
"name": "USE_SLIDER_ANALOG",
166+
"latestValue": "true",
167+
"subsystem": "THEME"
168+
},
169+
{
170+
"name": "NEED_EDITING_ICONS",
171+
"latestValue": "false",
172+
"subsystem": "THEME"
173+
},
174+
{
175+
"name": "SW_POLLING_MODE",
176+
"latestValue": "SWITCHES_POLL_EVERYTHING",
177+
"subsystem": "INPUT"
178+
},
179+
{
180+
"name": "SWITCH_IODEVICE",
181+
"latestValue": "devicePins",
182+
"subsystem": "INPUT"
183+
},
184+
{
185+
"name": "ENCODER_PIN_A",
186+
"latestValue": "7",
187+
"subsystem": "INPUT"
188+
},
189+
{
190+
"name": "ENCODER_PIN_B",
191+
"latestValue": "6",
192+
"subsystem": "INPUT"
193+
},
194+
{
195+
"name": "ENCODER_PIN_OK",
196+
"latestValue": "5",
197+
"subsystem": "INPUT"
198+
},
199+
{
200+
"name": "ENCODER_BACK_PIN",
201+
"latestValue": "-1",
202+
"subsystem": "INPUT"
203+
},
204+
{
205+
"name": "ENCODER_NEXT_PIN",
206+
"latestValue": "-1",
207+
"subsystem": "INPUT"
208+
},
209+
{
210+
"name": "PULLUP_LOGIC",
211+
"latestValue": "true",
212+
"subsystem": "INPUT"
213+
},
214+
{
215+
"name": "ENCODER_IS_QUARTER_CYCLE",
216+
"latestValue": "false",
217+
"subsystem": "INPUT"
218+
}
219+
],
220+
"namingRecursive": false,
221+
"useCppMain": false,
222+
"saveLocation": "ONE_SINGLE_FILE_MENU_MAIN",
223+
"useDynamicMenus": true,
224+
"usingSizedEEPROMStorage": false,
225+
"eepromSaveMode": "DYNAMIC_WRITE_BY_ID",
226+
"eepromDefinition": "",
227+
"authenticatorDefinition": "",
228+
"projectIoExpanders": [
229+
"deviceIO:"
230+
],
231+
"menuInMenuCollection": {
232+
"menuDefinitions": []
233+
}
234+
},
235+
"stringLists": []
236+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* A very simple TcMenu app that was built using https://designer.thecoderscorner.com/
3+
* It is setup out of designer to run an R4Nano with SSD1351 OLED and a rotary encoder.
4+
*
5+
* It is almost unchanged from what came out of designer itself.
6+
*
7+
* Pin configuration:
8+
* Encoder: A and B are on 6 and 7, select is on 5
9+
* Display: CS=10, DC=9, RS=8. Hardware SPI.
10+
*/
11+
#include "NanoR4RGB_menu.h"
12+
13+
void buildMenu(TcMenuBuilder& builder) {
14+
builder.usingDynamicEEPROMStorage()
15+
.analogBuilder(MENU_COUNT_ID, "Count", DONT_SAVE, MenuFlags().readOnly(), 0, nullptr)
16+
.offset(0).divisor(1).step(1).maxValue(255).unit("tms").endItem()
17+
.actionItem(MENU_ADD_ID, "Add", NoMenuFlags, tcAdded_onAddToCount);
18+
19+
setTitlePressedCallback([](int id) {
20+
showVersionDialog(&applicationInfo);
21+
});
22+
}
23+
24+
void setup() {
25+
setupMenu();
26+
}
27+
28+
void loop() {
29+
taskManager.runLoop();
30+
31+
}
32+
33+
void CALLBACK_FUNCTION tcAdded_onAddToCount(int id) {
34+
getMenuCount().setCurrentValue(getMenuCount().getCurrentValue() + 1); // Added by generator for the count example
35+
}

0 commit comments

Comments
 (0)