Using the GPIO

Gert’s video on Wednesday explaining how to fix up your own ribbon cable with a press connector (much cheaper and easier to source than buying a finished one in the shops) got a lot of people asking for more information on using the Raspberry Pi’s GPIO (general purpose input/output) pins. So here’s another video from our friend RaspberryPi Beginners – he has a whole YouTube channel full of these tutorials, and they’re very helpful – showing you what’s what.


Learning the command line

I posted this shell tutorial from Linux Command on Twitter earlier today. It’s had so many retweets and favourites that I thought it deserved a spot here as well for those of you who are new to Linux and want to get to grips with the command line in preparation for your Raspberry Pi.

Let us know how you get on!


Pi3D

Liz: Some news from Tim Skillman – which is going to be particularly interesting for those of you who wanted to use the accelerated 3D potential of the Raspberry Pi, but who didn’t fancy getting down and dirty with OpenGL ES. Pi3D is still a work in progress, but there’s already plenty you can already it do with it if you’re interesting in playing with 3D models on your Raspberry Pi. Tim includes download links for the module and for some examples. Over to Tim!

Pi3D is a Python module designed to open up the 3D abilities of the Raspberry Pi BUT with a difference: it will provide simple yet powerful functions for kids (and adults) to create 3D with very little knowledge of programming. The main aim of Pi3D is to instil some fun and excitement and get kids (and adults) coding!

Eventually, Pi3D will import and render several 3D & 2D file formats, create 3D objects, fractal landscapes, compile scenes into vertex arrays and render shaders. Pi3D is in its early stages although you can already experiment with both 3D models and 2D sprites (similar to pygame – but much faster and more capable!) Pi3D also uses the Python Imaging Library, so this will need to be installed first (instructions with the code).

The pi3d module is accompanied with four examples, ‘boxtest.py’, ‘raspberry_rain.py’, ‘bouncing balls.py’ and ‘clouds3d.py’ that demonstrate both 3D and 2D rendering. The code is available at www.github.com/tipam/pi3d or download it now at https://github.com/tipam/pi3d/tarball/master

Pi3D was initially based on Peter de Rivaz’s pyopenegl ‘Mandelbrot’ example and both of us have since been developing the code. Have fun!


Hardware lesson with Gert: make your own ribbon cable connector

Someone in our forums was asking yesterday where he could buy some ribbon cable with a press connector for his Raspberry Pi, to attach to the GPIO pins. Pre-built cables like this are hard to find, and the options other people on the forums found were pricey, and also attracted large shipping costs. So Gert stepped in: here’s how to build your own using parts (which you should be able to buy from your local electronics store).


Raspberry Jam

Raspberry Jams are being set up by users all over the UK (and further afield – I’ve heard whispers about one in Melbourne, Australia); they’re monthly meetings for Raspberry Pi owners and enthusiasts, hobbyists, developers, teachers, students and families. The Foundation isn’t directly involved in the Jams – they’re being set up by people like you, and they’re places where you can meet other Pi-thusiasts, learn to use a Raspberry Pi, listen to talks and see demos, and generally get to muck around with some like-minded people. If you’d like to read more on where they’re taking place (and what you can do to set up one in your neighbourhood), there’s some useful information here from our friend TeknoTeacher.

The first Cambridge Raspberry Jam (you’ll need to apply for a ticket, but these are free) will be held on July 14 at the University of Cambridge Computer Laboratory, the Raspberry Pi’s spiritual home. It’s being organised by the excellent James Abela. Although the Foundation doesn’t set these events up, a lot of us will be attending this one: Eben and I will be there, Gert will be bringing a Gertboard and some other hardware for a demo, and JamesH will have some wafers, some chips for you to look at and prototype Raspberry Pis – I’ll see what I can do about getting someone to bring the camera board (still a work in progress) along too. Alex Bradbury (asb on the forums, and our lead software guy) is coming, and we’ll all be making ourselves available to chat as well as doing a Q&A session. We’re looking forward to it; it should be really good fun, and I believe there is also a Pi and Pint session planned for the pub afterwards.

For a flavour of what a Raspberry Jam can be like, we’ve got a guest post today from Dan Hett, a Raspberry Pi owner who was at this weekend’s Manchester Raspberry Jam at MadLab, organised by Ben Nuttall. This post is also available to read on Dan’s own blog; we’re very grateful to him for allowing us to use it. Over to you, Dan!

**

Yesterday I had the privilege of attending Manchester’s first Raspberry Pi event, called (what else?) the Raspberry Jam, hosted by Madlab. It turned out to be a great day, and I’m glad everyone braved the rain to make it.

I’d received my own Raspberry Pi a few days ago, and hadn’t had much chance to really get to grips with it. It attracted a lot of attention in the studio, word spread around that a few of us had received our boards and from that point onward we had a steady stream of nerds coming over to fawn over them for the rest of the day. It’s not hard to see why: they’re strikingly small, to the point where it’s hard to believe these tiny things are usable computers (“where’s the rest of it?” came up a few times).

I got my board home and was expecting a bit of a fight getting it set up: Twitter and the RaspPi forums give the impression at the moment of it being a struggle for some, and being a Linux newbie I wasn’t expecting it to be a smooth process. However, I was up and running in about an hour, after using the RaspPiWrite tool to download and create a Debian SD card image. Rather than doing everything manually, the tool (a python script you run through the terminal) does everything for you. I left it running, and without any hiccups I had a working Pi:

(Eagle-eyed readers will note that it’s running on a bedroom TV rather than a monitor: the Raspberry Pi doesn’t have VGA out (and quite right too), instead using HDMI as the primary output. This does present a problem for me, as I only have an old VGA monitor, so for now I’ve moved the TV out of the bedroom and stuck it on my desk. Sorry, wife!)

So, on to yesterday’s jam. It was a full house, which was great to see. Lots of people already had boards with them, and generally everyone was up and running with them already. The organiser, Ben Nuttall, gave an intro talk, which turned into kind of a roundtable discussion about what people want from the day, which was great to see. There was a good mix of people: a few curious developers like me, some more visual people, a couple of completely none-tech folks who’d seen all the press coverage, and everyone in between.

One of the things I was really pleased about was the fact that there were a few younger members in attendance too: of course one of the big objectives with the whole Raspberry Pi concept is to get it into schools and shake things up, so it was really interesting to speak to some of the kids and find out what they think of the whole thing (general consensus was very enthusiastic, but being a geek meetup this was probably a biased cross-section of people to survey!)

I met one of the youngest Manchester Girl Geeks, 13 year-old Amy, who’d come to the event with her mum Lisa and her little brother Dan. I was helping them get their Pi up and running, and while we were waiting for it to download Amy showed me the work she’d been doing using Scratch: I was absolutely blown away. Amy had created a full Pac Man clone, with collision detection and scoring and everything, using no code. She was explaining that you can import photos into Scratch too, so we challenged her to add her own face into the game in the place of Pac Man. Challenge accepted! Amy took two photos (so she could make it look like she was chomping like Pac Man, of couse), cropped them down in Scratch…

…and then replaced the artwork in-game:

Scratch also comes bundled with the Debian distro we’d installed, so Amy immediately transferred her files over to the Raspberry Pi and carried on making games. Impressive.

Meeting Amy and Dan has really got me thinking: I have a young sister about the same age, and I think she’d absolutely love to get stuck into the Girl Geek thing. I’ll definitely be following their events more closely now, I had no idea that all age ranges were catered for. They’re doing great work, and it would be great to support them, so hopefully I’ll be able to add a Girl Geek to their ranks!

There were a couple of great sessions over the day too, which were small half-hour talks that happened alongside all the general tinkering. The first one I caught was an intro to 3D printing, which was really interesting. 3D printing as a technique doesn’t appeal to me much, as I don’t know what I’d really use it for (although that doesn’t usually stop me messing with stuff), but it was really cool to hear about how it all works. There were some 3D-printed Raspberry Pi cases passed around, which were really neat. I might ask the guys at Hacman really nicely if I can print out my own case (although a Lego option is sounding good too).

The other session I caught was an intro to Python for none-programmers. It was of course really basic, but actually served as a good intro to the language for me too. Python is again something I’m not sure I’ll currently need in any practical sense, but I find it incredibly interesting as a language compared to the kind of strictly-typed code I work with now. Python is also the language that’s being pushed alongside the Raspberry Pi in an education setting, so I’m interesting in picking it up a bit more just out of sheer curiosity. Of course, our intrepid Girl Geek Amy immediately left the Python session and got herself up and running in an IDE (with a little help from organiser Ben):

The final session I caught a bit of was Bob’s talk on coupling the Pi with an Arduino to work in hardware projects, which was another really interesting use for it. At £25, it’s feasible to utilise a board permanently for a project, it’s cheaper than an Arduino Uno and you can do anything with it.

And that was that. The Raspberry Jam turned out to be a really great event, and I think everyone gained a lot from it. I was kind of on the fence about how practical the Pi really is, but actually as a device it’s cheap and small enough to do absolutely anything with it. It’s going to be very interesting to see if this community enthusiasm carries over to the education side, and I sincerely hope it does. In the meantime, this kind of event is exactly what the community needs to be doing: making lots of noise about the cool stuff we’re doing, and increasing the chances of more people picking it up. As a developer with sisters of high school age, it was really amazing to see someone like Amy pick up this technology and run with it. Hopefully this will continue!

Big thanks to Ben for organising the event, and of course Madlab as always for making sure this kind of thing keeps happening in Manchester. High-fives all round!


OK – I lied. THIS is the final video from Maker Faire.

Turned out that George from element14 still had another video up his sleeve. This really is the last one: a short Q&A with Eben and me about the Foundation. I am, as some bright spark will doubtless point out in the comments, really really awkward in front of cameras (which is why you don’t ordinarily get to see much of me). And very short.


BBC news video – Raspberry Pi at St Matthew’s primary school

The BBC’s news videos usually aren’t embeddable until a day or so after their first release, so you’ll have to go to the BBC News website to watch this, but it’s well worth the click.

Pete, some primary school students, and ten Raspberry Pis. (That's Sue looking on from the corridor.) Click the image to watch on the BBC website.

Our good friends Dr Sue Black of the GoTo Foundation, and Pete Wood from RS Components, took a class of seven to nine year-olds (years 3 and 4) at St Matthew’s Church of England Primary School in Surbiton, Surrey, and got them programming the Raspberry Pi in Python as part of a GoTo Foundation event. The results were pretty fantastic – the kids were buzzing, got playing with embedded hardware as well as software, and gave us all a neat demonstration of just how tractable and enjoyable programming can be for children, if they’re only given the opportunity to dig a little into it.

Some kids of this age have trouble with the dexterity needed to type accurately (which is one of the reasons we recommend Scratch for younger students), and this is reflected in the video; it can be very frustrating to type a piece of code in over and over and keep getting it wrong. But others were flying with the Raspberry Pi, and were clearly more than ready to tackle some Python, getting lots out of the experience.

We’re really proud to see so many happy faces from the lesson. Work continues on getting stuff ready for the schools release (which will also include cases for the Raspberry Pi) later in the year. We hope to see lots more of this kind of teaching session to come.


Monday grab bag

I’ve been sent links to a lot of cool stuff the community’s been working on over the weekend. Here are a few items which really tickled me.

@Jojoreloaded has ported Frontier, the sequel to Elite (David Braben, who developed both games, is one of the Raspberry Pi Foundation’s trustees), to the Raspberry Pi. Frontier, unlike Elite, has a shareware licence; I hope @Jojoreloaded also shares his code so we can all have a go! It’s a DOS game, so the last time I saw a working version (curse you, ubiquitous Windows) was on a friend’s Amiga at school.

Matt at Exaviorn has come up with RasPiWrite, an Mac OS X script which automates the preparation of your Raspberry Pi SD card. I’ve been using it myself, and it does what it says on the tin; I think it’s the first such tool available for the Mac, and it’s extremely straightforward. Just follow the instructions he’s put online.

Quentin Stafford-Fraser has put together a nice little embedded hardware app for changing the bandwidth on a couple of webcams so he can press a button to switch from a monitoring state, where the cams take pictures every second or so, to a state where they’re taking several FPS if he needs a closer look at whatever’s going on. (There are flashing LEDs too!) He uses the framebuffer interface in PyGame – there’s no need for XWindows or any of that jazz.

Click to view a larger version on Twitter.

Richard Leggett has been using Cortex to do genome assembly and variation analysis on E.coli using the Raspberry Pi. We’re pretty sure this is the first genetics application we’ve seen running on the device. 7pm – I stand corrected! Here’s a forum thread I was pointed at in the comments that says otherwise.

If you’ve been doing something cool with your Raspberry Pi (or have spotted someone else online doing something you think should get a wider audience) and you have some video or screenshots you think we’d be interested in sharing with the community, please drop me an email at liz@raspberrypi.org.


Eben gives a demo

I think this is the last of the Maker Faire videos – this is proving to be a really busy weekend, so without further comment, here’s Eben, a Raspberry Pi, a big telly and a crowd of people.

Thanks again to everyone at element14 who helped us out with this, especially George, who filmed and edited all the Maker Faire video, and Janice, who took us out for dinner even though she turned out to be feeling too poorly to eat anything herself.


Biz’s LEGO case – the Boreatton Scouts hit Germany.

Biz, age 12, is a member of the Boreatton Scouts Robo Club. When we featured them in a post a few weeks ago, we had a number of requests for instructions on making the LEGO Raspberry Pi case she’d created. She’s sent me some instructions and photos – thanks Biz!

The Scouts are in Mannheim, Germany today. They’re representing the UK in the FIRST LEGO League Open Robot Championship; judging is taking place today. We thought you’d like to see the extremely swanky uniforms they’re using for the contest, and Cazz, another Scout, agreed to model them here. (Note left arm.)

Over to Biz for case instructions. Thanks again, Biz; and good luck to all of you in Germany!

First make a two layer base – we had to use blue and red because that’s what we had – it is 13 splots by 9 (awkward!)

Now we add some flat bits to hold the Pi so the solder bits don’t get scraped when we plug things in and out.

You can load the RasPi in now or wait until the end!

Now build the walls – one layer at a time! Again we just used what bits we had.

Going up!

Oops! A bit fuzzy!

Tah dah!

Now we need a lid – again the lego sizes are a bit inconvenient and so we have a notch in the bottom edge and a corresponding hole that we were short of bits to fill.

Actually that turned out to be quite handy as we have an easy detachable half lid that gives access to pinouts and test points.

Now for the cute bit...

Here are the bits...

Had to make it double thickness and again ran out of a splot - but that doesn't show!

And finally a round mini-splot to attach to the case (and hide the hole in the roof).

Cute!

And that's Biz's RasPi case!