Nov 052012
 

Download Python Gertboard Programs

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.

buttons

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.)

Download Python Gertboard Programs

  6 Responses to “Gertboard software in Python 2.7 – part 2 – ocol and buttons”

  1. […] did some preliminary tests with the Python version of the Gertboard ocol (open collector) program I wrote, using it to switch leds on and off. I love leds, but they’re a bit tame aren’t they? […]

  2. Alex,

    Many thanks for your excellent test programs which, having just received the Gertboard, are proving very useful. I have used the LED testing program and the buttons program. The LED program works without issue, and the Buttons program works as described in your video …… except…, even with the jumpers in U3-out-B1, U3-out-B2 and U3-out-B3, the LEDS don’t light up to reflect the position of the switches. Do you have any suggestions on what could be wrong?

    Thank again,

    Kevan

    • Oooops, I now realise why the Buttons wasn’t working as it was meant to i.e. no LEDS lighting. I had forgotten to power the board using the power jumper!!!

      Thanks

  3. Hello Alex, my dad has ordered a RasPIO Duino for me so while I’m waiting for it I’m going through the gertboard programs using a Raspi 2. I’m still on the buttons program. I have got gerts c program working by altering the common.c file before running make all. I also have your buttons-rg.py working fine without any alteration but I can’t get buttons-wp.py to work. I have updated wiringPi by following gordons instructions on his site. Do you have any idea what could be the problem ? My dad is away to Le-mans until next week and he said I should try and work it out for myself. Thank you,

    Toby

Leave a Reply