flask gpio test
This commit is contained in:
parent
4f08084d39
commit
3c40b1fe61
@ -19,7 +19,7 @@ for pin in pins:
|
|||||||
GPIO.output(pin, GPIO.HIGH)
|
GPIO.output(pin, GPIO.HIGH)
|
||||||
|
|
||||||
for pin in pins_in:
|
for pin in pins_in:
|
||||||
GPIO.setup(pin.nr, GPIO.IN)
|
GPIO.setup(pins_in[pin]['nr'], GPIO.IN)
|
||||||
|
|
||||||
@kamera_server.route("/")
|
@kamera_server.route("/")
|
||||||
def main():
|
def main():
|
||||||
@ -27,7 +27,7 @@ def main():
|
|||||||
for pin in pins:
|
for pin in pins:
|
||||||
pins[pin]['state'] = GPIO.input(pin)
|
pins[pin]['state'] = GPIO.input(pin)
|
||||||
for pin in pins_in:
|
for pin in pins_in:
|
||||||
pins[pin]['state'] = GPIO.input(pin)
|
pins_in[pin]['state'] = GPIO.input(pin)
|
||||||
|
|
||||||
# Put the pin dictionary into the template data dictionary:
|
# Put the pin dictionary into the template data dictionary:
|
||||||
templateData = {
|
templateData = {
|
||||||
@ -58,7 +58,7 @@ def action(changePin, action):
|
|||||||
for pin in pins:
|
for pin in pins:
|
||||||
pins[pin]['state'] = GPIO.input(pin)
|
pins[pin]['state'] = GPIO.input(pin)
|
||||||
for pin in pins_in:
|
for pin in pins_in:
|
||||||
pins[pin]['state'] = GPIO.input(pin)
|
pins_in[pin]['state'] = GPIO.input(pin)
|
||||||
|
|
||||||
# Along with the pin dictionary, put the message into the template data dictionary:
|
# Along with the pin dictionary, put the message into the template data dictionary:
|
||||||
templateData = {
|
templateData = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user