Python is one of the most popular languages in the last years, it’s used by Google for their search engine and many other apps like game designs, databases etc.
Python combines the easy of use of the interpretive languages with powerful datastructures, so it replaces the old days BASIC but opens up lot of new possibilities.
The best of all are the Python libraries you can see thousands of these at https://pypi.python.org/pypi
A13-OLinuXino as any Linux platform can run Python language, what we were missing was GPIO library which to allow Python users to have access to A13-OLinuXino GPIOs.
Now this library is done! You can download is from https://pypi.python.org/pypi/pyA13/ or from GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/PYTHON-A13-GPIO
then install it:
#tar -zxvf pyA13-0.1.7.tar.gz #cd pyA13-0.1.7.tar.gz #sudo python setup.py install
after the installation you can use it this way:
#sudo python >>> import A13_GPIO as GPIO >>> GPIO.init() #init GPIOs >>> GPIO.getcfg(GPIO.PIN37) #config PIN37 as GPIO >>> GPIO.setcfg(GPIO.PIN37, GPIO.OUTPUT) #config PIN37 as output >>> GPIO.output(GPIO.PIN37, GPIO.HIGH) #set PIN37 high >>> GPIO.output(GPIO.PIN37, GPIO.LOW) #set PIN37 low >>> GPIO.setcfg(GPIO.PIN37, GPIO.INPUT) #config PIN37 as input >>> GPIO.input(GPIO.PIN37) #read PIN37
PINxx assignments is exactly as per A13-OLinuXino schematic
EDIT: Maximum GPIO toggle speed via Python is 101 kHz