Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By vdubadub
#61595
flywire wrote:Output and line 20 from debug as shown in my previous post. Full code follows:

Code: Select allcls

let pinNo = 0
let pinStat = 0
print "Pin Number"
textbox pinNo
print "Pin Stat"
textbox pinStat
button "Set Pin", [SetThePin]
button "Set Pin PWM", [SetThePinPWM]
button "Exit ", [TestExit]
wait


[SetThePin]
print "Pin Number"
print pinNo
print "Pin Stat"
print pinStat
po pinNo pinStat
wait

[SetThePinPWM]
print "Pin Number"
print pinNo
print "Pin Stat"
print pinStat
pwo pinNo pinStat
wait



[TestExit]
end ' See more at: http://www.esp8266.com/viewtopic.php?f=40&t=4849#sthash.67P35vQf.dpuf


Okay easy fix!
Mistake i used to make playing with examples early on..

So your line 20 and 28 need to be changed just a little
line 20 should read io(po, pinNo, pinStat)
line 28 should read io(pwo, pinNo, pinStat)

i could post the fixed code for you to swap but I'm pretty new myself and I find getting in there and changing/modifying/fixing these examples myself has been the best learning experience :D !
also the driving lessons and beginners guide thread are worth reading, rereading and reading again!
User avatar
By trackerj
#61597 Try this one:

Code: Select allcls
let pinNo = 5
let Brightness = 890
print "Control PIN"
textbox pinNo
print " Brightness"
textbox Brightness
button " Set Brightness ",[SetBrightness]
button " Exit ", [TestExit]
wait

[SetBrightness]
io(pwo,pinNo,Brightness)

wait

[TestExit]
end
User avatar
By Electroguard
#61603 Or with a brighness slider control added...

Code: Select allcls
let pinNo = 1
let Brightness = 890
print "Control PIN"
textbox pinNo
print " Brightness"
textbox Brightness
slider Brightness,0,1024
button " Set Brightness ",[SetBrightness]
button " Exit ", [TestExit]
wait

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

[TestExit]
end