'For ESP Basic Alpha 3.xx Branch
'The following code will dim an led on pin 2 using a slider control
'This LED is Blue color in NodeMcu board
lightlevel = 0
slider lightlevel, 0, 1023
button "Set level", [set.it]
wait
[set.it]
io(pwo, 2, lightlevel)
wait
Moderator: Mmiscool
If you add this...
timer 200,[set.it]
into the code and then a textbox to show the value it will update the light level automatically.
see example below
regards
dwight
'For ESP Basic Alpha 3.xx Branch
'The following code will dim an led on pin 2 using a slider control
'This LED is Blue color in NodeMcu board
lightlevel = 0
wprint "0 "
slider lightlevel, 0, 1023
wprint " 1023"
button "Set level", [set.it]
print " Light Level Now = "
textbox lightlevel
timer 200, [set.it]
wait
[set.it]
io(pwo, 2, lightlevel)
wait
- See more at: http://www.esp8266.com/viewtopic.php?f=40&t=6537&start=4#sthash.qFM08C6d.dpuf