-->
Page 2 of 4

Re: GPIO and PWM with GUI

PostPosted: Thu Jan 26, 2017 10:48 pm
by vdubadub
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!

Re: GPIO and PWM with GUI

PostPosted: Thu Jan 26, 2017 11:08 pm
by heckler
IO(PWO,{PIN},{VALUE})


Is it possible that you need some commas in the PWO and or the PO statements?

hope this helps
dwight

Re: GPIO and PWM with GUI

PostPosted: Thu Jan 26, 2017 11:15 pm
by trackerj
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

Re: GPIO and PWM with GUI

PostPosted: Fri Jan 27, 2017 4:48 am
by Electroguard
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