diff --git a/scripts/light.py b/scripts/light.py new file mode 100644 index 0000000..9e11dc3 --- /dev/null +++ b/scripts/light.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +import RPi.GPIO as GPIO +import sys + + +GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) + +state = int(sys.argv[1]) + + +def light(state): + + if state == "on": + GPIO.output(21,GPIO.HIGH) + if state == "off": + GPIO.output(21,GPIO.LOW) + +light(state)