Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.