pls find here ( attached ZIP ) my first working example, what combines all 3 ways to deal with serial input:
input check NO WAIT for a operator menu system ( by one character )
( what still allow the main loop to run 1000000 / 16sec. )
input question .. answer
for string / and number int/real with default number / type WAIT with time out
stream by serialEvent for sensor input from T3 (MEGA)
connected sensor: http://atlas-scientific.com/product_pages/sensors/ec-sensor.html
looks like:
KLL serial menu
adjust terminal to AUTOSCROLL, Carriage Return, 115200
hit [space] [ENTER] to get MENU list
MENU:
[space] this list
[d] enable diagnostic
[t] enable timecheck
[n] test number input
__________sensor ___________________
[c] send measure command to sensor T3
[e] send measure stop command to sensor T3
[i] send ref info command to sensor T3
select:
sensor on T3 command I<CR>
E,V3.0,4/12
sensor on T3 command C<CR>
2045,1104,0
2178,1176,0
2000,1080,0
debug ON
T3: 32 T3: 30 T3: 30 T3: 30 T3: 2C T3: 31 T3: 30 T3: 38 T3: 30 T3: 2C T3: 30 T3: D2000,1080,0
T3: 32 T3: 30 T3: 32 T3: 32 T3: 2C T3: 31 T3: 30 T3: 39 T3: 32 T3: 2C T3: 30 T3: D2022,1092,0
T3: 32 T3: 30 T3: 32 T3: 32 T3: 2C T3: 31 T3: 30 T3: 39 T3: 32 T3: 2C T3: 30 T3: D2022,1092,0
debug OFF
1978,1068,0
2022,1092,0
sensor on T3 command E<CR>
Question numberinput, default 98.7654:
int: -3456 real: -3456.79
Question numberinput, default 98.7654: no number input, use default!
int: 98 real: 98.77
serial_menu_T3stream.zip (4.62 KB)