-->
Page 2 of 2

Re: slider html gui widget light dimmer

PostPosted: Tue Feb 28, 2017 2:50 pm
by dziloo@wp.pl
I Update The Code for ESP Basic Alpha 3.xx Branch. Working very good !!!

Code: Select all
'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


Re: slider html gui widget light dimmer

PostPosted: Tue Feb 28, 2017 8:32 pm
by heckler
Hi dziloo,
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. :D

see example below

regards
dwight

Code: Select all'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