Skip to content

Instantly share code, notes, and snippets.



Last active Jul 1, 2020
What would you like to do?
from flask import Flask
import RPi.GPIO as GPIO
channel = 21
# GPIO setup
GPIO.setup(channel, GPIO.OUT)
app = Flask(__name__)
# these shouldn't really be GET, idempotency etc.
def open_gate():
GPIO.output(pin, GPIO.HIGH) # activate the gate
def open_gate():
GPIO.output(pin, GPIO.LOW) # deactivate the gate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment