#! /usr/bin/env python import RPi.GPIO as GPIO import aaargh app = aaargh.App(description="An application that controls the digital pins of the raspberry pi using the terminal.") app.arg('--pinno', help="The selected pin number, the default is 13", default=13) @app.cmd def switchOn(pinno): '''Switches on a particular pin.''' GPIO.setup(pinno,GPIO.OUT) GPIO.output(pinno,True) print 'pin ' + str(pinno) + ' is on' @app.cmd def switchOff(pinno): '''Switches off a particular pin.''' GPIO.setup(pinno,GPIO.OUT) GPIO.output(pinno,False) print 'pin ' + str(pinno)+ ' is off' if __name__ == '__main__': app.run()