ocol – Open Collector – Darlington Array Relay Driver
I’ve managed to get the open collector ocol program written in Python. The ocol program drives the Darlington Array on the Gertboard. This can be used to switch up to 6 relays, each on a separate GPIO port. I’ve managed to write versions for both wiringpi for python (ocol-wp.py) and RPi.GPIO (ocol-rg.py)
They are both included in the download link, which will always contain the most up to date versions. Here’s a comparison video of Gert’s ocol program running first, then my Python version.
And this weekend I seem to have been on a roll, so I got the buttons program written too. This one is only done with RPi.GPIO because I can’t find how to set the pullups to up using wiringpi for python.
buttons-rg.py – buttons program using RPi.GPIO is also in the zip file to download. This program enables you to test the three buttons, which you can use as inputs to the GPIO. You can see the port status changes on the screen immediately. (You can hook up led indicators too.)
via RasPi.tv http://raspi.tv/2012/gertboard-software-in-python-2-7-part-2-ocol-and-buttons