Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Electroguard
#61965 I seem to remember someone asking if a slider value could be read and actioned without needing to press a 'read' button.

The answer is 'yes' if using a timer, as shown in the attached script.
Note that the new value only gets read when the slider is released.
Code: Select allcls
let pinNo = 1
let Brightness = 512
print "Control PIN"
textbox pinNo
print " Brightness"
textbox Brightness
slider Brightness,0,1024
timer 200,[SetBrightness]
'button " Set Brightness",[SetBrightness]
button " Exit ", [TestExit]
wait

[SetBrightness]
io(pwo,pinNo,Brightness)
wait

[TestExit]
end     
User avatar
By heckler
#61967 Thanks Electroguard (and Mike)

With a few simple changes to your example we now have an awesome SERVO tester...

Code: Select allcls
let pinNo = 2
let Servo = 90
print "Control PIN"
textbox pinNo
print " Servo"
textbox Servo
slider Servo,0,180
timer 200, [SetServo]
'button " Set Servo", [SetServo]
button " Exit ", [TestExit]
wait

[SetServo]
io(servo,pinNo,Servo)
wait

[TestExit]
end     

' See more at: http://www.esp8266.com/viewtopic.php?f=40&t=4849&start=12#sthash.zNjuKBPy.dpuf


I am continually astonished and amazed at how easy it is to implement code with Mike's espBASIC !!! :D :mrgreen:

For me there is simply NOTHING else that compares.
dwight