Tag Archives: Stuff About Code

Using Minecraft: Raspberry Pi Edition to get kids computing

via Raspberry Pi

After a workshop last week, Clive, our Director of Educational Development, sent me the following in an email:

A parent came up to me, and said: “I’m concerned that on Minecraft you can blow things up with TNT, it’s all about destruction, I’m worried about the effect on children…”

If you ever want to make a six-foot-one Liverpudlian with a motorcycle cry, just repeat that sentence to him. Clive has been inconsolable for days. Why? Because Minecraft: Raspberry Pi Edition is a teaching and learning tool we’ve found absolutely invaluable. It’s a powerful way to get kids who didn’t realise they had an aptitude for programming excited about the Pi; it’s a creative, constructive tool; kids and teachers love it; and we find it’s enormously popular with kids all over the world. At an event this weekend, Carrie Anne Philbin and Alex Bradbury witnessed children crying (and I promise we are not the sort of people who try to make children cry) when asked to allow other kids to have a go.

Here’s Martin O’Hanlon, of Stuff About Code, to explain why teaching with Minecraft is such a good idea. This video was filmed at last month’s Raspberry Jamboree: thanks to Alan O’Donohoe for filming it.

We’re very close to launching our new website now: you’ll be able to see it, and the learning resources we’re producing, around the beginning of April. We’ll have plenty of Minecraft resources to show you then, packaged for teachers and for pupils. We hope you’ll enjoy using them as much as we have enjoyed making them.

GPS-tracking helmet cam

via Raspberry Pi

Martin O’Hanlon’s a familiar name in these parts, especially for fans of Minecraft: his repository of Pi Minecraft tricks and tutorials is one of our favourite resources. But Martin’s not all about magicking Menger-Sierpinski Sponges into the Minecraft universe: he does wonderful stuff with hardware and the Raspberry Pi too. Here’s some footage from his latest:

What you’re looking at here is something we haven’t seen before: camera footage with a GPS overlay, showing the route Martin has skied and his current speed. (Gordon, who has his own helmet cam hack, is quivering with envy.) Martin’s setup, like all the best Raspberry Pi hacks, also involves tupperware. It’s a one-button, one-led design, so it’s as easy as possible to use when you’re wearing ski gloves.

Work in progress

You can find everything you’ll need to construct your own at Martin’s Stuff about Code; he’s also done a very detailed writeup of the design process and included plenty of construction tips, along with the usual code and parts list. Thanks Martin!

Carputers – some ideas to get you started

via Raspberry Pi

We are firm believers in the idea that computing starts to get really interesting – interesting enough to suck in people who have never programmed before – when you begin interfacing software with real things made out of atoms. That’s why there are GPIO pins on the Pi (another reason you should never tread on one with bare feet). Here are some resources to get you started with some real-world hacking: namely, hacking your car.

The usual disclaimers apply here. Don’t be stupid. Don’t drive along typing, watching videos, playing Transport Tycoon Deluxe or anything else that’s likely to get you killed. You’d make us feel bad, and you’d embarrass the people who know you. Don’t mount any part of your kit on a sharp pointy thing that might impact your body if you crash. Use common sense.

With a Pi, you can build a customised, specialised pieces of equipment; and you’ll want your carputer to do things that a laptop sitting on the passenger seat wouldn’t be able to do. Martin O’Hanlon (who maintains a blog with some of the best Minecraft: Pi Edition hacks we’ve seen – go and check it out) has been busy with car diagnostics, which is as good a place as any to start.

It turns out that there’s a standard for reading data from all makes of modern car, called OBD-II (on-board diagnostics II). Your car can communicate all kinds of data that you may not even have known it was collecting, like the volume of particulates being absorbed by the filter, the temperature of the air coming into the car, or results from the oxygen sensor; and the things you might expect, like oil pressure or speed and distance travelled. You can then process that data to output figures on useful things like fuel economy.

(Martin’s using the screen of that Samsung laptop as a display for his Pi for the time being.)

Consumers can buy a USB to OBD2 interface cable – Martin’s was about £10 on eBay.

Reading and displaying this data is the first step in what Martin hopes will be a larger project. Those of you making carputers will find the ability to do this useful too – it’s well worth being able to work out for yourself why the mysterious red light on your dashboard has come on, without having to spend money at the garage just to find out that your oil levels were low. Martin has forked some existing software from GitHub so that he could find out what sensors were supported by his Lotus, and poll the car every 0.5 seconds, writing the sensor data to the screen.

To run Martin’s code on your own Pi, open a terminal and type:

sudo apt-get install python-serial
sudo apt-get install git-core
cd ~
git clone https://github.com/martinohanlon/pyobd
cd pyobd
python obd_capture.py

Once you’ve got the data from the car out of the way, of course, there’s a lot more you can do with a Pi to make being in the car a bit more fun. First off, there’s music: you can turn your Pi into a Spotify server (you’ll need a premium Spotify account) or a Pandora jukebox.

And, of course, you’ll want GPS and a camera. Using a Raspberry Pi camera board and a separate GPS module hooked up to the Pi, Chicago Electronic Distributors (who specialise in Pi stuff, if you’re in the market for some kit) built a reversing camera and in-car GPS. They’ve also been using another Pi with a camera board as a dashcam.

We’ve been racking our brains about what else you might want in a carputer. Emma suggests you might like to add a thermometer to your Pi too, to log the internal temperature of your car “in case of dogs”. Rob wants disco lights. (You could use a LED matrix for this – I’d be tempted to mount such a matrix in the back window and scroll obscenities at people behind me with their headlights on full beam.) And I would also like a robot valet with a teeny-weeny vacuum cleaner, and something to count the change in the ashtray, but that might be a step too far. JamesH races cars – he’s been talking about infrared sensors for the tyre temperature and accelerometers to measure G-force when taking corners, which might be a bit more practical.

Finally, you’ll want to install the thing. Now, you can do what Chicago Electronic Distributors did and just mount a screen on velcro or attach it to the windscreen with a sticky cup, and hide the Pi itself in the glovebox or the boot: but where’s the fun in that? We found a lovely album of pictures from LuckyJezster, one of our forum members, who is refurbishing a 1980s Ford F120. With a Pi. Here’s his post about the process – click on the image of the Pi he’s embedded in the central console and covered with plexiglass to see the photo album. Blue LEDs! Lovely clicky switches! A Pi logo hand-engraved with a knife!

Are you working on your own carputer? Does your Pi have wheels? Have we missed anything glaring that any carputer worth its salt should have? Let us know in the comments.

Abattoir! A topical Scratch game.

via Raspberry Pi

Martin O’Hanlon from Stuff About Code (you might recall Thursday’s post about his adventures in Minecraft) has written a Scratch game that made us laugh. Hard.

Wherever you are in the world, you’ve probably heard something about the recent horsemeat adulteration scandal in Europe, where cheap beef mince products like lasagna and frozen burgers turned out to be anything up to 100% horse. In Abattoir! you’ll be making sure that only delicious cow makes it into the mincer. Have a look at this video for some gameplay.

Get the code at Stuff About Code.

Hacking the Minecraft world

via Raspberry Pi

If you’re a Minecraft fan and a Pi owner, you’ve probably already downloaded a copy of Minecraft: Pi Edition. But are you getting the most out of the fact that you can modify the world with code in-game?

If you’re not sure where to start, or if you’re looking for ideas (sometimes being given a blank canvas can be lousy for getting the brain sparking), Martin O’Hanlon at the marvellous <Stuff about=”code” /> has several tutorials on Minecraft: Pi Edition, from installing the game to using the Minecraft API to build wonderful things, like magical bridges that appear where’er you walk, games of hide and seek, and in-game analogue clocks.

The hide and seek hack is easy and rewarding: with a little coding you’ll be able to get the game to hide a diamond somewhere in the world for you to find, and to give you hints of the warmer/colder variety.

You can find code and an explanation of what’s going on over at Stuff About…

And we’re all agreed that the clock is just brilliant (it’s also big enough that you can go and stand on the hands). Again, the project has its own page with code and a spot of discussion.

We’d love to see what you’ve been doing in Minecraft – take some video, or write something about your experiments on your own website, and let us know about it!