In the 4 weeks since the Pi camera came out, I’ve spent a fair amount of time testing and fiddling with different things. I’ve also made two RasPiCamcorders – I hope to document the Mk2 version soon. It’s the reason I haven’t blogged much in the last week. I’ve been working on the hardware and software for it. One thing I hadn’t done until this week was test out the various settings for exposure compensation and white balance. Previously, I’d only used the automatic settings, which work pretty well. But there are some circumstances where […more…]
In part 1 of this series, we looked at the basic commands for using software pulse-width modulation (PWM) in RPi.GPIO 0.5.2a and higher. In this article we’ll get a bit more hands-on and into some practical applications for it. It’s all very well being able to make nice square-wave pulses on an oscilloscope, but what’s it actually useful for? Our servo said? EEEEH AAAAH I tried using RPi.GPIO soft PWM with servos in response to a query after the last article, but, although it did change the servo positions, it was jittery. Servos require quite […more…]
Back in November I made a Raspberry Pi controlled “light and fan relay switching” demo that you may have seen before on the Official Raspberry Pi blog. Before it appeared on the Raspberry Pi web site, I’d previously displayed it at Milton Keynes and Oxford Raspberry Jams and I’d also taken it along to let my year 5 ICT class have a go with it. Did they like it? You can see for yourselves in the video what the year 5s thought of it. I didn’t tell them what was going to happen, as I […more…]
The Tandy Multiface is a brand new I/O interface board for the Raspberry Pi designed by Darren Grant from Tandy. The reason it came about is that, back in September 2012, Tandy was marketing a Gertboard kit, having bought a supply of official Gertboard PCBs from Farnell. This was a bit of a coup because Tandy beat Farnell to the punch with their own product. Farnell struggled to get their ducks in a row (I seem to remember comments about a shortage of one of the chips) and launched their kit about a month later. […more…]
Over the last couple of weeks the pace of development for Python programmers who like to dabble in GPIO has gone up a gear. Both main GPIO systems for Python on the Raspberry Pi have been getting some enhancements. RPi.GPIO, now at version 0.5.2a, has interrupts and threaded callback capability. You will probably have seen my three recent posts showing how to use those. WiringPi for Python version 2 is in Beta testing. I discovered two bugs while I was trying it out. Both of those have been squashed. One by Gordon “Drogon” Henderson in […more…]
Multiple threaded callback interrupts in Python We’ve been learning about interrupts this week because of the brand new interrupt capabilities of RPi.GPIO. We covered a simple “wait for” interrupt in part 1, threaded callback interrupt and button debouncing in part 2 and today we’re getting sophisticated with multiple threaded callbacks. “WoooooooooOOOOOOOOOOOOOOOooooooooooo”, I hear you say. ;) Well actually, we’re not doing much that’s very different from last time, except, now there’s more of it. We’ll add another button and another threaded callback function the same as the first one (but on a different GPIO port). […more…]
Interrupts are an efficient way for a program to be able to respond immediately to a specific event. In the previous article I explained the basics of using interrupts in RPi.GPIO and gave an example of a simple “wait for an event” interrupt program. In this second article I will introduce “threaded callback” which opens up a lot of new possibilities. Threaded callback – what the heck is that? I know it sounds complicated. And it probably is complicated in the C code it’s written in, but we’re Pythonites and we don’t have to go […more…]
The latest big news in the world of Raspberry Pi Python GPIO programming is that Ben Croston has released an update for RPi.GPIO. Why is that a big deal? Because this version has interrupts. “What’s an interrupt?” I hear you say. It’s a way of waiting for something to happen without checking constantly whether or not it’s happening. Imagine that you’re waiting for a delivery – something you’re really excited about – like a Pi camera.You spend far too much time looking down the street in eager anticipation of the postman’s arrival. You can’t fully […more…]
Lithium polymer batteries are light and powerful, but they can’t be run completely flat or they are ruined. I’ve been using them for several years to fly model planes, so I have plenty of them around. I’ve also been using them at Raspberry Jam meetings to power some of my Pi demos. I thought it would be fun to make a circuit so the Pi could monitor its own battery voltage. I used an analog to digital converter (mcp3002) and had the Pi check the battery voltage every minute and shut down when the battery […more…]
Matt Hawkins from Raspberry Pi Spy has done the leg-work enabling Pi users to use a Wii controller – along with a Bluetooth USB dongle to send inputs to the Raspberry Pi. It uses a Python library called “CWiid” (I imagine this is pronounced “seaweed”). This is awesome because the Wii controller has 11 different digital inputs. When you consider combinations of inputs, that gives you a lot of extra possible “input commands” to play with. Theoretically*, with 11 buttons, there are 55 different 2-button combinations (11C2). That should be enough for most uses. If […more…]