Project

General

Profile

Download (399 Bytes) Statistics
| Branch: | Tag: | Revision:
import sys

import RPIO

def main():
if len(sys.argv) < 2:
print 'Error, you must specify at least one argument'
return
# Use the BCM addressing scheme
RPIO.setmode(RPIO.BCM)

# Setup output
RPIO.setup(17, RPIO.OUT)
if sys.argv[1] == '1':
RPIO.output(17, True)
print 'Relay on'
else:
RPIO.output(17, False)
print 'Relay off'



if __name__ == '__main__':
sys.exit(main())

(6-6/8)