Download various free and open source software offerings from RasPi.TV
RasPi.TV RPi.GPIO Quick Reference “cheat sheet”
A downloadable PDF with a full breakdown of RPi.GPIO commands and P1 ports for both Rev 1 and Rev 2 Pis and a full index of all 12 RPi.GPIO tutorials on RasPi.TV (Index also found here.)
There’s also a .txt version you can either download or wget straight onto your Pi.
Python Gertboard Suite New Release April 10 2013 Now with Support for TANDY Multiface :)
Download Gertboard Test Suite in Python 2.7
NEW Release of ALL Python Gertboard programs with support for the Multiface 10 April 2013
I’ve been through all the Gertboard Python programs (even found a bug in the ocol wiring instructions that nobody had told me about) and put in some wiring instructions for the new TANDY Multiface board.
Basically the experience won’t change at all for Gertboard users, but Multiface users will need to add an “m” to the end of the command to run the programs. This will identify the board as Multiface and ensure you get correct on-screen wiring instructions.
Other than that I have tidied up the code, but it won’t mess up any of what was written in the Python section of the Gertboard manual, so that is all still valid.
Walkthrough of all Python Gertboard programs is now in the official Gertboard Rev 2 manual 23/01/2013
This is applicable to Rev 1 Gertboards too as the programs are identical.
In November 2012 I decided to do Python versions of Gert and Myra’s Gertboard test programs. By end August 2013 we’ve had >6,766 downloads and very little feedback, which I’m assuming means that it just works OK for you all. :)
To download to a PC/Mac (or in the browser on your Pi), click the link here…
To download directly from your Pi’s command line, go to the directory where you want the .zip file and punch in the following…
then, have a look at the README.txt file
cd GB_Python (CTRL+X to exit)
To run one of the programs, type…
sudo python program_name.py (substituting the program’s name for program_name)
If you want to use the wiringPi versions, you’ll need to install WiringPi for Python.
Instructions for this are in the README file.
If you want to use the atod, dtoa or dad (analog < > digital converter) programs, you’ll need to ensure that spi is enabled and py-spidev is installed (instructions in README file).
Further Reading and Videos
To read more about the software and see videos of it in action…
I installed this and it worked nicely. I tried both versions rp.py and wp.py for every test i applied. :-)
That’s great – must be why I’ve had so little feedback from >400 downloads :-D
People are quite quick to tell you when something doesn’t work, but it’s really nice to hear about when it does. :yes:
Thanks Kenneth. :-)
Thanks for your support around the Gertboard and Python. I am an old engineer, returning to Linux operating system. It was absolutely pleased with RaspberryPi and software developed by you to work for me.
Congratulations and much success.
Thanks Erwin, although Kenneth is a “customer” of this free software. I wrote it.
I guess I confused the issue by ending my last message with “Thanks Kenneth” :)
Not to worry
The address, https://raspi.tv/download/GB_Python.zip, is no longer valid.
Works for me.
Really enjoying this Gertboard software of yours..
Having great fun as a newbie getting stuff working.
Reading through your code is a massive help to my fledgling understanding of Python.
Anyhoo, many many thanks for your efforts and I wish you a happy new year..
Excellent. Very glad to hear it Philip.
It works fantastically and will make testing my Gertboard a lot easier.
I have an older Pi (256 Mb) and have recently purchased a fully-wired Gertboard. I have run the buttons and butled programs (with the jumper options) and the switch states are correctly shown on the monitor but none of the LEDs’ light up. I have also run the C versions with the same result. I think that there may be a fault with the Gertboard but Farnell are not convinced. Is there any reason that these programs may not work on an older pi?
I have run the LED programs and they appear to work as they should albeit with only the 10 link wires. I have seen all the LEDs’ light up so I know they function
Any suggestions would be greatly appreciated.
The programs were written on old pis, so there’s no reason why they shouldn’t work. You have got the J7 jumper on the top 2 pins haven’t you? People forgetting to place that jumper have had some odd results.
I didn’t realise I needed to do that. Looking at the diagram I guess that is to feed 3V3 volts to the circuit? Sorry to ask a dumb question, but do I need to do that for all the tests?
As you can guess I am still learning!
Yes – it’s early on in the manual as part of the setup process. Just put one on there and leave it there for good. It’s what enables the regulator on the board, otherwise you are taking power from the 3v3 supply of the pi, which has none (not much) to spare. :) This is why when it’s not on, the board struggles with the leds.
Alex, thank you for solving that problem. A classic case on my part of not RTFM!
Can I just confirm one more thing and that being the butled program; the LED associated with buf 6 goes out when button 3 is pressed (goes low). The fact that this LED 6 follows button presses is not software driven but is a hardware function?
I ask this because when I power up the Gertboard, all of the LEDs’ are lit and with the butled links mounted, the LED will follow the button presses even before the program is run. Anyway sorry to take up so much of your time and I look forward to seeing more of your YouTube videos.
John that is all working as it should be. The new assembled Gertboard has pull-up resistors which the self-assembly kit didn’t have, so the leds are all pulled up to high by default (which is why they are lit unless driven otherwise). I found it a bit confusing to start with too, but once I got my head round it (mind you there’s always something round the corner to trip you up – wouldn’t be any fun if it was too easy ;) )
Thank you so much for all your help.
I have been a professional technician since 1968, and still run into the issues you have. It is not that often now, but it still happens with new systems.
I expect the same problems for myself on the programming side of these boards. But, we have a great Unix/Linux community here to assist.
Best of “luck”.
When I look at the schematics rev 3 A-2, all jumpers are upnumberd p1 -p24. It will be easy that the name off the jumpers will corresponding with the names on the pcb. Is it possible to make a new schematic.
That’s nothing to do with me. I suppose you should query that on the forums :)
Thanks. I finally found code samples for spidev that was easy to read and understand so I can get started with SPI.
Have been looking at a lot of blogs and posts in various forums, and this is by far the best code samples I’ve found.
I know it’s not actually relevant here, but do you happen to know if spydev offers control over CE polarity?
If I’m reading spydev_module.c right then this functionality is supported in C, but I can’t find it exposed in Python. Is this correct?
If there’s no control over CE polarity, do you know if I can use the CE pins as output pins while using the SPI.
Also, do you know if the MISO pin can be used for other purposes if I do not need MISO functionality (while using SPI)?
Again, Thanks for the effort
I haven’t seen anything about polarity. I think py-spidev gets confused if you mix the port functions with ordinary GPIO.
Thanks for providing the Python code for the Gerboard, its exactly what I’ve been looking for to get me up and running with some real world external interface code for my Gertboard. I want to use my Pi to interface to the outside world so this is relevant programming for me. I’m completely new to programming and now got myself a Python Programming book, this along with your simple code, means that I can follow it through and understand most of it! I’ve even been able to put my own simple modifications in and get it working too, so I’m really happy! Thanks again because I had no chance with the C stuff!
I would like to use the c programs does anything need editing?
I don’t think so. Just follow the download instructions in the Gertboard manual.
[…] RPi.GPIO tutorials, (e.g. interrupts and PWM) but not done anything more basic, apart from the Gertboard examples. So here’s an attempt to remedy that […]
I’ve just purchased a Gertboard and managed to get some of the tests running with your GB_Python code. I had some problems though and I’m wondering whether everything is up to date here?
1. When I installed wiringPi it gave me wiringPi2 without any option for the earlier version.
2. At one point I was asked to “$ sudo apt-get install python-pip” but it wanted to drag in python 2.6 as a dependency. This seemed a bit regressive so I abandoned it and found another way.
3. GB_Python didn’t work first time. After a little searching I decided that changing “import wiringpi” to “import wiringpi2 as wiringpi” would solve the problem and it certainly solved most of them.
4. There were still problems with constant definitions. In the old Wiringpi-Python constants were all defined at the top level of the module as well as in the GPIO class, Wiringpi2-Python seems to have removed the module level definitions so they are all undefined in the GB_Python programs.
5. I solved 4. by adding a line “gpio = wiringpi.GPIO()” near the top of the modules and then changing each constant use from e.g. “wiringpi.PUD_UP” to “gpio.PUD_UP”
It seems possible that GB_Python could be altered to work with both the old and new wiringpi though I haven’t looked at the more complicated programs yet.
Is this of interest to anyone? Have I missed something? Should I make my changes available to others? What would be the best way to do this? a git pull somewhere perhaps?
Is there a way to turn off the message:
RuntimeWarning: A physical pull up resistor is fitted on this channel!
When GPIO02 or GPIO03 is controlled?
I know the message can be ignored. But it results in soooo many questions from other users of my script. They freak out when an error message shows up in the terminal window. They are afraid something is going to fry!
Unfortunately, GPIO.setwarning(False) does not appear to turn this message off.
Is there another creative way to turn this off?
Maybe with a TRY: and then catch the exception?
my board is restartiing every time when i play youtube videos
More than likely this is a “marginal power supply” issue