Pin status check with basic
Posted: Sat Nov 28, 2015 4:43 am
After trying a million ways from Sunday
I would like the ability to check pin status of an output much like the vars page now does in code.
I think it makes since to want to know if something is on or off and if you were to visit the page again
have it change with the static and not remain a static value.
I have tried with buttons and msg handler etc but for some odd reason the value always sits static even with buttons it just has got to be something that needs to be added somehow. I thought it may just be me for some time now but after following all examples to a T I have deduced that it simply appears to be impossible without modification to the code.
However there is hope it can be done with LUA and it is done on the var's page in basic so I feel it may be my incorrect ways of approaching the problem maybe I need to use:
onload xxxxx
Which I would like to see an example of.
Or possibly an html variable .
I've messed with both very little and don't know if I am doing things correctly and will mess with them some more as time provides but really this should be a fairly basic thing to do one would assume or implement at least. I appreciate the attempt at the vars page showing pin stats and such but for my project I would like to print out or display information relative to the status of the pin. For instance "Light 1 is On"
I apologize if there is some way of doing this that I was already told and it was overlooked or not working or if you already explained to me how to accomplish it but I have taken what was explained and ran with it for hours trying many different ways of storing values and different places of running the code different ways of terminating the values.
I have began to reduce the code to its simplest form as above to make the discovery how to do this an easier process rather than 50 lines of code I have cut it down in hopes to get status of one pin and have it update when the status changes.
Other things I could try are loading picture buttons if the status is currently On have on be lit up green etc... But really I would like to handle with MyMsgBranch if possible I don't want to have buttons hosted on the esp per say just the ability to see the status and send on/off commands to it.
Dynamic Values I believe would be the correct terminology. Maybe I could have just little pictures and text load to show the status I really don't know but if the text stays static chances are so will the pictures.
Anyhow just a suggestion in the suggestion box even if it somehow scrapes the values off of the vars page and allows me to put the values in plain english as such and such is off or on.
I would like the ability to check pin status of an output much like the vars page now does in code.
I think it makes since to want to know if something is on or off and if you were to visit the page again
have it change with the static and not remain a static value.
Code: Select all
if io(pi,D1) = 1 then statusofpin = "<p>Pin high</p>" else statusofpin = "<p>pin low</p>"
print statusofpin
Button "On" [on]
Button "Off" [off]
Wait
[on]
Po D1 1
Wait
I have tried with buttons and msg handler etc but for some odd reason the value always sits static even with buttons it just has got to be something that needs to be added somehow. I thought it may just be me for some time now but after following all examples to a T I have deduced that it simply appears to be impossible without modification to the code.
However there is hope it can be done with LUA and it is done on the var's page in basic so I feel it may be my incorrect ways of approaching the problem maybe I need to use:
onload xxxxx
Which I would like to see an example of.
Or possibly an html variable .
I've messed with both very little and don't know if I am doing things correctly and will mess with them some more as time provides but really this should be a fairly basic thing to do one would assume or implement at least. I appreciate the attempt at the vars page showing pin stats and such but for my project I would like to print out or display information relative to the status of the pin. For instance "Light 1 is On"
I apologize if there is some way of doing this that I was already told and it was overlooked or not working or if you already explained to me how to accomplish it but I have taken what was explained and ran with it for hours trying many different ways of storing values and different places of running the code different ways of terminating the values.
I have began to reduce the code to its simplest form as above to make the discovery how to do this an easier process rather than 50 lines of code I have cut it down in hopes to get status of one pin and have it update when the status changes.
Other things I could try are loading picture buttons if the status is currently On have on be lit up green etc... But really I would like to handle with MyMsgBranch if possible I don't want to have buttons hosted on the esp per say just the ability to see the status and send on/off commands to it.
Dynamic Values I believe would be the correct terminology. Maybe I could have just little pictures and text load to show the status I really don't know but if the text stays static chances are so will the pictures.
Anyhow just a suggestion in the suggestion box even if it somehow scrapes the values off of the vars page and allows me to put the values in plain english as such and such is off or on.