Hello. Sign in to get personalized recommendations. New customer? Start here.

Hi!   Sign in    Register

Home > life > Wireless Expert > The BBC Robot Wars micro:bit Coding Challenge

The BBC Robot Wars micro:bit Coding Challenge

2016/9/19 10:52:06     Source: SIG     Views:2468     Comments:0

Summary:bit Coding Challenge

Robot Wars is a BBC TV show featuring robots…and war.

Robot Wars works like this. Contestants, usually teams of two or more, build awe-inspiring, battling robots. They bring them on the show and fight other contestants’ robots in a purpose-built arena—all the time keeping an eye open for the fearsome and deadly house robots. You win a bout by immobilsing (e.g. by completely destroying) all the other robots or, if no clear winner emerges when time runs out, by judges’ decision. The judges assess each robot’s performance according to style, control, aggression and damage inflicted.

The house robots are large and scary machines capable of astonishing feats of utter destruction. They also have cool names like Sir Killalot, Dead Metal, and Shunt. Oh, and… Matilda. But don’t be fooled. Matilda is not one to mess with just because she doesn’t have an obviously fearsome name!

Robot Wars is, if you’ve not seen it, is very, very cool.

Inspiring Kids to Get Creative with Coding

That’s the tagline for the BBC’s self-appointed mission, to get kids coding (and making things), and use the micro:bit to do it. I’ve written about the micro:bit a few times before as you’ll see from my list of SIG blog posts.

Jo Claessens, a BBC producer, and one of the masterminds behind the original micro:bit vision, had a great idea of putting together a micro:bit coding challenge themed around Robot Wars, and to make this happen, contacted electronics kit makers and micro:bit partners, Kitronik and….me!

Code name: micro:bot

The idea was simple. Kitronik sells a micro:bit-controlled buggy kit which automatically follows black lines on the floor. Awhile ago, I’d rewritten its micro:bit code and created a mobile app that allowed the buggy to be driven using a smartphone connected to the buggy over Bluetooth—it would seem we had the raw materials for a nice coding and making project involving Bluetooth.

Kitronik set about designing new, add-on cladding for the buggy that made it look more…..“roboty.” I rewrote new versions of my controller app so it worked on both iOS and Android. Together, Kitronik and I wrote a step-by-step tutorial, with Kitronik focusing on hardware and me on software.

And then…..(drum roll)….we all met for what I shall henceforth refer to as “the best day at work ever!”

Somewhere in the Heartlands of England….

Last week, I spent half a day with a BBC team and the guys from Kitronik to help make a promo video for the BBC’s micro:bit website. This involved driving a number of the Bluetooth controlled Kitronik, “robotified” buggies around in front of a bemused, but remarkably tolerant, Sir Killalot whilst the whole lot was videoed for later editing.

Martin with microbotYes, I met Sir Killalot in person! We didn’t shake hands. If you watch the video you’ll see why!

The technology worked great. We executed our carefully choreographed maneuvers…..rather badly as it happens—more to do with our collective driving skills than anything else. If you watch the scene in Spinal Tap with the “small people” dancing around the miniature Stonehenge bumping into each other, it was kind of like that! The BBC cameraman managed to salvage the day and the results are really quite good.

 

Battle bots

A rare moment where we managed to drive in formation.

The basis for controlling the buggies was themicro:bit’s Bluetooth Event Service. There are two “game pads” on the mobile app’s UI, each with four pads.

microbit controllerTouching or releasing any one of them results in a unique event code, grouped together with a common “event ID” being transmitted to the micro:bit as a GATT characteristic write. Code on the micro:bit, which I created usingMicrosoft’s wonderful PXT tool, responds to the events received by switching on or off various digital pins on the micro:bit edge connector, which are connected to the buggy’s motors. And that is, as they say…. that!

(Credit: Martin Woolley)


About Product
An Intro to Blu

Bluetooth® technology is one...[More]

Bluetooth SIG M

The introduction of Bluetoot...[More]