Hi all, Im really new to coding and im trying to do a little project for learning purposes. Im controlling some leds attached to a raspberry pi.
Currently this is code im using to turn on the GPIO22: *on default.py* def index(): return dict(message='LED Test - Main Menu') def redon(): pinstatus=GPIO.input(22) GPIO.output(22,GPIO.HIGH) *on the default/index.html * {{extend 'layout.html'}} <html> <header></header> <body> <h1><font color="red">Red</font></h1> <button onclick="ajax('redon',[],null);"> {{=T('Turn On')}} </button> </body> </html> When i press the Turn on button it will turn the led attached to the GPIO22. What i would like to do its to display the "pinstatus" value on the index.html. The value will be either 0 or 1 ... so i would like to see something like this when i load the html ..... "Status: 0/1" Can anyone shed some light. Thanks, -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.