Coding with the BBC micro:bit this Summer
The BBC micro:bit is one of the biggest recent developments for young tech enthusiasts. Designed as a simple platform for introducing people to the basics of coding, the micro:bit has an incredible range of uses, and can be simply programmed with a range of languages.
Whether you’ve brought a micro:bit, want to make sure your child uses the one they received at school, or are just interested in some of the ways that micro:bits can be used, Exa Education have put together some information about 5 great programs, tools and games for the micro:bit.
We’ve made sure to pick some fun and genuinely useful projects, so read on to start exploring new ways to use the micro:bit - you’ll find simple projects at the top, moving into more complex projects by the end.
1: Creating a simple compass with micro:bit
Planning on exploring this summer? Using the micro:bit’s inbuilt magnetic sensor, making a compass to check your direction is a simple first project, requiring absolutely no extra sensors or equipment (though placing the completed compass in a case makes it a bit more suitable for hiking). Here’s a BBC lesson on using Touch Develop to create a compass - as a drag and drop visual programming language, Touch Develop is a great way to get started with coding.
2: Programming your own games with Kodu and a micro:bit
A bit different from the other projects we’ve listed here, this one doesn’t require programming the micro:bit. Kodu is a programming environment which lets you create your own games without much difficulty, whether you want to build a 3D platformer, puzzle game or more.
Kodu is fully integrated with the micro:bit, letting makers use the device to control the games they create, whether they’re controlling movement with the tilt sensors, using the buttons to activate features, or even using devices attached to the micro:bit.
Check out our earlier blog post on Kodu to find out more about how the system works.
3: Samsung and Code Club games and tools for micro:bit
The BBC isn’t the only source for micro:bit program ideas and information - phone makers Samsung and nationwide coding event organisers Code Club both have a large selection of projects freely available.
Code Club’s micro:bit projects are fairly simple, designed as great starters for anyone interested in coding. Their Against the Clock activity can be particularly useful if you need a simple timer/countdown, while their other projects include a great range of simple games.
Samsung also has some simple micro:bit activities like animations and games, but their website also has some far more advanced projects. These mainly involve connecting micro:bits to phones, unsurprisingly (though you don’t need a phone from Samsung - any smartphone should do): take selfies remotely using the micro:bit’s Bluetooth ability, set up a simple burglar alarm and more.
4: Starting out with micro:bit music
Amongst dozens of other features, the BBC micro:bit lets you easily create music from simple notes to full on tunes (not quite as full-on as it sounds - think early MIDI) - a great project for indulging your creative side. All you need is the micro:bit, some crocodile clips and a set of headphones.
Using Block Editor, another visual language, starting out with a tune is easy. Select the Play block, choose the note you want to play, and then choose how long the note lasts. Test it out by selecting a couple of notes, then put the program on the micro:bit. Attach crocodile clips to the 0 and GND pins, then clamp them onto your headphones - GND to the side of the headphone jack, and 0 to the tip.
Once that’s done, power up the micro:bit and you should hear music - watch out though, it can be pretty loud. You can also use Block Editor to play a tune when one of the micro:bit’s buttons is pressed - just use the Button is Pressed block.
Block Editor is ideal for simple tunes, but if you’re looking for something more complicated, Python is the way to go, letting you set tempos and create more detailed music. Head to the BBC’s micro:bit Musicfest page to find out more about using MicroPython for music.
5: Making micro:bit temperature sensors
2016’s already estimated to be the hottest year on record, with this week’s heatwave topping 30°C across much of the UK. With temperatures soaring, the micro:bit’s temperature sensing abilities are definitely going to be useful, whether you’re making a basic monitor to check the heat or putting together a thermometer for the barbecue.
While the micro:bit doesn’t have a full on temperature sensor, it can put together a close estimate (just off by a couple of degrees) of the heat by checking how hot the CPU is. A basic bit of Touch Develop code from the BBC lets you simply display the temperature.
basic → forever do var temp := input → temperature basic → show number(temp, 150) end
However, the micro:bit’s flexibility means that it’s pretty easy to get a more accurate reading with just a couple of extra parts. Attaching a thermistor to the micro:bit and calibrating it lets you get an exact measurement of the temperature at any point, and should let you measure the temperature of food/ liquid/ anything you wouldn’t want to put your micro:bit in. You’ll find a full guide to creating a micro:bit temperature probe here, though the information does get pretty complicated at times.