@@ -35,11 +35,7 @@ Print& operator<<(Print&o, Menu::prompt&p) {
35
35
}
36
36
#endif
37
37
38
- #ifdef ARDUINO_SAM_DUE
39
- #define LEDPIN 13
40
- #else
41
- #define LEDPIN A3
42
- #endif
38
+ #define LEDPIN LED_BUILTIN
43
39
44
40
// define menu colors --------------------------------------------------------
45
41
// each color is in the format:
@@ -55,13 +51,13 @@ const colorDef<uint8_t> colors[] MEMMODE={
55
51
56
52
// define menu outputs ------------------------------------------------
57
53
#define MAX_DEPTH 4
58
- /* const panel panels[] MEMMODE={{1,1,16,10},{18,1,16,10},{36,1,16,10}};
59
- navNode* nodes[sizeof(panels)/sizeof(panel)];
60
- panelsList pList(panels,nodes,sizeof(panels)/sizeof(panel));
61
- idx_t ansi_tops[MAX_DEPTH];
62
- ansiSerialOut ansi(Serial,colors,ansi_tops,pList);//the output device, ansi-terminal Cols x Rows
63
- menuOut* outputs[]={&ansi};
64
- outputsList out(outputs,1);*/
54
+ // const panel panels[] MEMMODE={{1,1,16,10},{18,1,16,10},{36,1,16,10}};
55
+ // navNode* nodes[sizeof(panels)/sizeof(panel)];
56
+ // panelsList pList(panels,nodes,sizeof(panels)/sizeof(panel));
57
+ // idx_t ansi_tops[MAX_DEPTH];
58
+ // ansiSerialOut ansi(Serial,colors,ansi_tops,pList);//the output device, ansi-terminal Cols x Rows
59
+ // menuOut* outputs[]={&ansi};
60
+ // outputsList out(outputs,1);
65
61
66
62
MENU_OUTPUTS (out,MAX_DEPTH
67
63
,ANSISERIAL_OUT(Serial,colors,{1 ,1 ,16 ,10 })// ,{18,1,16,10},{36,1,16,10})
@@ -238,11 +234,11 @@ MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
238
234
,EXIT(" <Back" )
239
235
);
240
236
241
- extern menu mainMenu;
242
- TOGGLE ((mainMenu[1 ].enabled),togOp,"Op 2:",doNothing,noEvent,noStyle
243
- ,VALUE(" Enabled" ,enabledStatus,doNothing,noEvent)
244
- ,VALUE(" disabled" ,disabledStatus,doNothing,noEvent)
245
- );
237
+ // extern menu mainMenu;
238
+ // TOGGLE((mainMenu[1].enabled),togOp,"Op 2:",doNothing,noEvent,noStyle
239
+ // ,VALUE("Enabled",enabledStatus,doNothing,noEvent)
240
+ // ,VALUE("disabled",disabledStatus,doNothing,noEvent)
241
+ // );
246
242
247
243
result alert (menuOut& o,idleEvent e) {
248
244
if (e==idling)
@@ -303,19 +299,16 @@ void setup() {
303
299
pinMode (LEDPIN,OUTPUT);
304
300
Serial.begin (9600 );
305
301
while (!Serial);
302
+ Serial.println (" ok" );
306
303
Serial<<" menu 3.0 test" <<endl;Serial.flush ();
307
304
nav.idleTask =idle;// point a function to be used when menu is suspended
308
305
mainMenu[1 ].enabled =disabledStatus;
309
306
nav.showTitle =true ;
310
- // nav.printMenu(1);
311
- // ansi.fill(1, 1, 2, 2, 'X');
312
- // Serial<<"pList[0]:{"<<pList[0].x<<","<<pList[0].y<<","<<pList[0].w<<","<<pList[0].h<<"}"<<endl;
313
307
delay (1000 );
314
308
}
315
309
316
310
void loop () {
317
311
nav.poll ();
318
312
digitalWrite (LEDPIN, ledCtrl);
319
- // digitalWrite(LEDPIN,!digitalRead(LEDPIN));
320
- delay (100 );// simulate a delay when other tasks are done
313
+ delay (100 );
321
314
}
0 commit comments