Jul 262013
 
How to use WiringPi2 for Python with pull-ups or pull-downs and PWM - pt 2

This is part 2 in a series on WiringPi 2 for Python. The basics are covered in part 1 (click here). You should read that first if you haven’t already, as we build on it here in part 2. Today we’ll cover three things… 1. Raspberry Pi board revision checking with WiringPi2 for Python 2. Using the Raspberry Pi’s internal pull-ups and pull-downs with WiringPi2 for Python 3. Using hardware PWM with WiringPi2 for Python 1. Checking your Raspberry Pi board revision number in WiringPi2 It’s quite useful to be able to check what version […more…]

Jul 232013
 
How to use WiringPi2 for Python on the Raspberry Pi in Raspbian part 1

Basic Input/Output with WiringPi 2 What is WiringPi2 and why do I need it? WiringPi2 for Python is an excellent GPIO handling system written by Gordon ‘Drogon’ Henderson and packaged for Python by Phil ‘Gadgetoid’ Howard. It uses Arduino-like scripting language. For simple GPIO work, I still tend to use RPi.GPIO because that’s what I first got started with, but WiringPi is a very good alternative. It currently has more features. One of the reasons (I think) the take-up for WiringPi-Python has been a bit slow, despite its richer feature set, is the lack of […more…]

Jul 192013
 
RPi.GPIO basics 7 – RPi.GPIO cheat sheet and pointers to RPi GPIO advanced tutorials

In the previous six articles, we’ve covered the basics of RPi.GPIO. I hope the series has been useful. While I was doing the “recap” for part 6, I decided to make myself a quick reference “cheat sheet” with all the common RPi.GPIO stuff in it. I figured this would be useful and save me having to look things up on the web and in previous Python scripts I’ve written. I made it as a text file that I can just copy and paste snippets of code from to make RPi.GPIO Python coding easier. Then I […more…]

Jul 172013
 
RPi.GPIO basics 6 – Using inputs and outputs together with RPi.GPIO - pull-ups and pull-downs

Today, it’s time for us to combine inputs and outputs into the same script. It’s nothing scary and it’s not new either. It’s simply a case of doing what we’ve already done in the last two days’ of GPIO basics, but combining them. To make it super-easy, we’ll even stick to the same port numbers we used for the last two days. We’re going to make a new program which takes parts from both the “read a button press” and the “flash an led every half second” programs. We’re going to make a simple new […more…]

Jul 152013
 
RPi.GPIO basics 5 – Setting up and using outputs with RPi.GPIO

Today is output day. I’m going to show you how to switch things on and off using RPi.GPIO to control the output ports of the Raspberry Pi. Once you can control outputs, you can, with a few additional electronic components, switch virtually anything on and off. Given the Raspberry Pi’s excellent connectivity, this means you can switch things on and off through the internet, using any computer, smartphone or tablet from anywhere in the world. You can also use a local network, Bluetooth etc. for short-range control. Setting up is very similar to the way […more…]

Jul 142013
 
RPi.GPIO basics 4 - Setting up RPi.GPIO, numbering systems and inputs

Well, today is the day we actually get to use RPi.GPIO a little bit. But, before we get to that, you should know about the two different numbering systems you can use with RPi.GPIO. If you take a look at the main GPIO header (P1) of the Raspberry Pi, you’ll see that there are 26 pins. The top left pin (as we look at this photo) is called pin 1, the one to the right of it is pin 2. So the next row is 3, 4 etc. and on down to 25, 26. This […more…]

Jul 132013
 
RPi.GPIO basics 3 - How to Exit GPIO programs cleanly, avoid warnings and protect your Pi

You might think I’m going about this series in a funny way. You’d be right! I am. That’s because I’m trying to highlight the bits that people don’t read about in other tutorials/documentation/manuals/books. These bits are useful, important and often overlooked. If I covered inputs and outputs first, you might not get to the rest because you’d already “know all I need”. That’s only partially true though. Although you can get away with not knowing or using this stuff, it’s much better and safer if you know it and use it. So today we’re focussing […more…]

Jul 122013
 
RPi.GPIO basics 2 – how to check what Pi board Revision you have

It all started in September 2012. The Raspberry Pi Foundation went and made some improvements to the Pi. How dare they!! ;) Seriously, though, there were some significant improvements to the Pi and a Rev 2 version was launched with double the RAM and some other changes/additions/improvements. This threw up some minor headaches for developers because some of the GPIO pinouts were changed and some new GPIO ports were made available on a brand new “solder it yourself if you want it” header called P5 (see the leaning header of Pi5a) GPIO 0 became GPIO […more…]

Jul 112013
 
RPi.GPIO basics 1 - how to check what RPi.GPIO version you have

It struck me the other day that I’ve published some fairly advanced 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 situation. Over the next few days, we’re going to have a walk around Ben Croston’s RPi.GPIO, which is now at version 0.5.3a. Some of this stuff may be new to you even if you’ve been using RPi.GPIO’s more advanced features, so it’s worth having a look. What is RPi.GPIO? It’s an easy way of controlling the Pi’s General Purpose […more…]

Apr 282013
 
Cyntech GPIO Breakout Paddle Board Review

The Cyntech GPIO paddle board is a new type of breakout board for the Raspberry Pi. It’s nice and small (about half the size of the Pi) elegantly simple, and I like the connectors. To connect a wire, you hold down the orange tab, push your wire into the hole and release the tab. The wire is gripped by a spring-loaded contact. It comes with a very nice “rainbow” ribbon cable, which is much more cheerful to look at than a grey one and it’s a decent 20cm length as well. You don’t always want […more…]