Created
April 3, 2020 14:34
-
-
Save Everlanders/4bf6b0b1a516aca4423a38824fbefeec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#!/usr/bin/env python | |
import os | |
import glob | |
import time | |
import RPi.GPIO as GPIO | |
import sys, getopt | |
import decimal | |
# Setup the IO | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BCM) | |
LEFTSOLAR = 18 | |
RIGHTSOLAR = 27 | |
GPIO.setup(LEFTSOLAR, GPIO.OUT) | |
GPIO.output(LEFTSOLAR, False) | |
GPIO.setup(RIGHTSOLAR, GPIO.OUT) | |
GPIO.output(RIGHTSOLAR, False) | |
number = int(sys.argv[1]) | |
if number == 0: | |
GPIO.output(LEFTSOLAR, False) | |
GPIO.output(LEFTSOLAR, False) | |
print ("Retracting Solar Array") | |
exit() | |
if number == 1: | |
GPIO.output(RIGHTSOLAR, True) | |
print ("Deploying only the right panels") | |
exit() | |
if number == 2: | |
GPIO.output(LEFTSOLAR, True) | |
print ("Deploying only the left panels") | |
exit() | |
if number == 3: | |
GPIO.output(RIGHTSOLAR, True) | |
GPIO.output(LEFTSOLAR, True) | |
print ("Deploying both sets of panels") | |
exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment