Skip to content

Commit 55d23c2

Browse files
committed
3.0
esp web menu
1 parent 3adaf4e commit 55d23c2

File tree

30 files changed

+651
-450
lines changed

30 files changed

+651
-450
lines changed

README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ void loop() {
8181
- Tested on Arduino: AVR, ARM, Teensy 3.2, ESP8266
8282
8383
## Dependencies
84+
This library depends on the following libraries:
85+
86+
- Streaming https://github.com/scottdky/Streaming (on debug mode)
87+
- Assert4a https://github.com/nettigo/Assert4a (on debug mode)
8488
85-
Streaming - https://github.com/scottdky/Streaming
89+
Depending on the type of input or output, other libraries might be needed. Essentially any library needed for your devices.
8690
8791
## Menu structure elements (macros)
8892
89-
This macros define read-only static menu structure.
93+
This macros define read-only static menu structure (PROGMEM on system that support it).
9094
9195
**OP** - define a prompt with associated action function
9296
@@ -99,11 +103,10 @@ result goFun() {Serial.println("done!");return proceed;}
99103
OP("Go!",goFun,enterEvent)
100104
```
101105

102-
Creates an 'anonymous' option as a parent menu element. This option is associated with an action function to be called according to elements mask.
103-
Prompt's are the menu basic structure, all other elements will share its poroperties. That is all can have a title, and action function and an event mask.
106+
Creates an 'anonymous' option as a parent's menu element. This option is associated with an action function to be called according to elements mask.
107+
Prompt's are the menu basic structure, all other elements will share its poroperties. That is all can have a title, an action function and an event mask.
104108
The action function will be called on every event occourence.
105-
The action function can sen back some 'result' information to be interpreted nby the caller. The meaning of this result depends on the caller and they might ignore it.
106-
Current styles have no meaning on simnple prompts.
109+
The action function can send back some 'result' information to be interpreted by the caller. The meaning of this result depends on the caller and it might ignore it.
107110

108111
**MENU** - define a menu
109112

@@ -120,7 +123,7 @@ a menu object 'id' is statically created and can be refered in your sketch by it
120123
);
121124

122125
void setup() {
123-
myMenu[2].disable();
126+
myMenu[2].disable();//example of disabling a menu option
124127
}
125128
```
126129
@@ -156,7 +159,7 @@ MENU(myMenu,"Schedule",doNothing,noEvent,wrapStyle
156159

157160
```
158161

159-
**TOGGLE** - define varible value by toggling from an enumerated list of possible values. Change value every click.
162+
**TOGGLE** - set a variable value by toggling from an enumerated list of possible values. Change value every click.
160163

161164
TOGGLE(var.name, id, title, action, event mask, styles, value, value [,value ...])
162165

@@ -167,20 +170,21 @@ TOGGLE(dir,dirPinMenu,"Dir: ",doNothing,noEvent,wrapStyle
167170
,VALUE("Down",LOW,doNothing,noEvent)
168171
);
169172

173+
//hooking the toggle to a menu
170174
MENU(myMenu,"Schedule",doNothing,noEvent,wrapStyle
171-
,SUBMENU(disPinMenu)
175+
,SUBMENU(dirPinMenu)
172176
,...
173177
);
174178
```
175179

176-
Creates a menu like structure enumerating all possible values of the associated var.
180+
Creates a menu-like structure enumerating all possible values of the associated var.
177181

178182
**CHOOSE** - define varible value by chosing from an enumerated list of possible values. Enumerated list of values shown as a submenu.
179183

180184
CHOOSE(var.name, id, title, action, evant mask, styles, value, value [,valu ...])
181185

182186
```c++
183-
int chooseTest=-1;
187+
int chooseTest=-1;//some variable used by your code (not necessarly an int)
184188
CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
185189
,VALUE("First",1,doNothing,noEvent)
186190
,VALUE("Second",2,doNothing,noEvent)
@@ -260,14 +264,6 @@ nav.doNav(upCmd);
260264
**scrlDownCmd** N/A
261265

262266

263-
## Dependencies
264-
This library depends on the following libraries:
265-
266-
- Streaming https://github.com/scottdky/Streaming (on debug mode)
267-
- Assert4a https://github.com/nettigo/Assert4a (on debug mode)
268-
269-
Depending on the type of input or output, other libraries might be needed. Essentially any library needed for your devices.
270-
271267
## Limits
272268

273269
- when using macros the menu is limited to 16 options (current macro limnit).
@@ -293,7 +289,7 @@ Serial https://www.arduino.cc/en/Reference/Serial
293289

294290
Standard arduino LCD library https://www.arduino.cc/en/Reference/LiquidCrystal
295291

296-
F Malpartida's LCDs (ex: i2c LCD) (not yet implemented on v3)
292+
F Malpartida's LCDs (ex: i2c LCD)
297293
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
298294

299295
Adafruit's GFX devices
@@ -305,9 +301,15 @@ http://www.rinkydinkelectronics.com/library.php?id=51
305301
U8glib devices
306302
https://github.com/olikraus/U8glib_Arduino
307303

304+
U8G2 devices
305+
https://github.com/olikraus/u8g2
306+
308307
Serial ANSI terminal
309308
https://github.com/neu-rah/AnsiStream
310309

310+
Web browser (experimental)
311+
when using ESP devices
312+
311313
### Input devices
312314

313315
Serial https://www.arduino.cc/en/Reference/Serial
@@ -320,6 +322,9 @@ Generic keyboard (no PCINT) - configurable for digital or analog keyboards (v2.x
320322

321323
ClickEncoder https://github.com/0xPIT/encoder (not yest implemented on v3)
322324

325+
Web browser (experimental)
326+
when using ESP devices
327+
323328
## History
324329

325330
### 3.0

TODO.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,17 @@ iteration levels
6666
1 - event messages <- require navNode
6767
2 - nav commands <- apply to root!
6868
3 - input <- relly on nav path status
69+
70+
71+
formating
72+
73+
1 - use fmt template class wrapping menuOut
74+
+ this is nice independente and interchangeable
75+
- cannot print specialized field/values templates
76+
2 - use derivation classes
77+
- cant use multiple outputs on same structure
78+
3 - use specialized function to print html
79+
+ outputs call specialized thing
80+
4 - use generic format
81+
+ fmt should be used by elements and not by the output
82+
- still field elements needs to print min/max for html

examples/Serial/ansiSerial/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ lib_dir=~/Arduino/Libraries
1515
platform = atmelavr
1616
board = nanoatmega328
1717
framework = arduino
18-
build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-strict-aliasing
18+
build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-strict-aliasing -DDEBUG
1919

2020
;[env:teensy31]
2121
;platform = teensy

examples/Serial/serialio/serialio/serialio.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ void setup() {
131131
while(!Serial);
132132
Serial<<"menu 3.0 test"<<endl;Serial.flush();
133133
nav.idleTask=idle;//point a function to be used when menu is suspended
134+
//StringStream inStr("322+*");
135+
nav.doInput("323");
136+
//while(inStr.available()) nav.doInput(inStr);
134137
}
135138

136139
void loop() {

examples/esp8266/WebServer/WebServer/data/r-site.css

Lines changed: 0 additions & 27 deletions
This file was deleted.

examples/esp8266/WebServer/WebServer/data/r-site.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/esp8266/WiFiServer/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/esp8266/WiFiServer/.travis.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)