Friday, 23 March 2018

RenderConf and Web Bluetooth

Today I had the pleasure to be a speaker at RenderConf in London. I can't tell you how impressed I was with this event. Professional, friendly and accessible (the first event I've ever seen do live captioning). And every speaker I saw, which was most of them were great speakers and evident experts in their field. Brilliant.

And.... this was the first web developer event I'd ever been to, never mind spoken at. The topic of my presentation was Web Bluetooth. I believe it should be a W3C standard. I see immense opportunities in creating web applications for monitoring and controlling smart buildings, industrial processes and IoT in general. The remote delivery of health care, incorporating the Bluetooth medical devices the patient has, is another obvious way this technology could deliver substantial value.

My talk introduced Web Bluetooth, how Bluetooth is being adopted more widely for enterprise applications and how in the enterprise world, the browser is the application platform. From this we must surely conclude that the browser needs Bluetooth. QED :-)

I did two live demos. Web browser versions of my Bitty Data Logger and Bitty Controller applications and they both worked a treat. I knew they would of course. I wasn't nervous. Oh no. Not a bit :-)

You can download my slides from here.


And thank you, thank you, thank you to RenderConf!

Friday, 5 January 2018

Bitty Data Logger 3.2.0 - Formula Management

Bitty Data Logger allows expressions or formulae to be specified and applied at run time to data values sampled from the micro:bits connected pins. Analog pin values are always in the range 0-1023, regardless of what is connected to the pin and so a pin formula allows values to be transformed to something more meaningful like a Celsius temperature value. Version 3.2.0 adds a Formula Management screen so that lists of named formulae may be maintained and selected for use via the Settings screen. This makes use and reuse of formulae for different experiments and other activities, much easier.

Saturday, 23 December 2017

Debugging micro:bit code using the serial port and USB

Debugging micro:bit code can be tricky. It can only display one character at a time so the LED display is not a great option, though you'll be surprised how much you can still get done when you need to.

You can write full strings and variable values to the serial port however and so by connecting your micro:bit into a computer using a USB cable and firing up a terminal application like Putty, you can monitor serial output as your micro:bit code executes.

This is a great way to get to the bottom of weird code problems you just can't figure out!

Here's how you'd do this from C/C++

uBit.serial.printf("P0:%d P1:%d P8:%d P12:%d\r\n", pin0, pin1, pin8, pin12);

Friday, 15 December 2017

4tronix Bit:Bot and Bitty Controller

New hex files have been published at which allow Bitty Controller to be used with the 4tronix Bit:Bot

Note that a new version of Bitty Controller is in development and this will provide data from the Bit:Bot sensors as well as allowing it to be driven. But there's no need to wait because both the existing d-pad and touchpad controllers in Bitty Controller work today as long as you install the right hex file on your Bit:Bot mounted micro:bit!

Provisioning a Silicon Labs Bluetooth mesh developer board

Provisioning is the process which makes a Bluetooth mesh device a secure member of a specific mesh network. It involves a smart phone or tablet, running an application known as the Provisioner and results in the Bluetooth device being issued with a series of security keys. Conceptually it's comparable with Bluetooth pairing but technically is not the same and is concerned with the security of a whole network, not just the security of a pair of devices.

For a more technical explanation of Bluetooth mesh, download the Bluetooth Mesh Technology Overview document from

There are also numerous blog posts on various aspects of the topic:

Here's a quick demo of me provisioning a Silicon Labs Blue Gecko developer  board which is running a Bluetooth mesh stack with software models that make it equivalent to a mesh light.

Thursday, 14 December 2017

Remote control your smartphone camera with a micro:bit

Using your micro:bit as a remote control for the camera on your smartphone is easy.

I wrote a quick MakeCode application which lets you take a photo by pressing button A on the micro:bit and have shared it at this URL: 

The "Tell camera" block is in a special package called Devices. You need to add it to your MakeCode project. You do this by going into the Advanced section at the bottom of the list of block categories on the left, click Advanced, then Add Package and then select Devices. When it asks if you should remove the Radio package,confirm that it should.

The procedure you should then follow with an Android phone is this:

1. Download the hex file from MakeCode and copy it to a micro:bit. I used USB for this. 

2. In Android, go into Settings/Bluetooth and if the micro:bit is listed as paired, "Forget" it. You need to forget pairing every time you flash a hex file as the pairing details get deleted from the micro:bit, leaving the phone thinking it's paired and the micro:bit thinking it is not. They both need to think they are paired or they both need to think they are not paired otherwise Bluetooth communication will fail, with one side trying to perform encrypted communication and the other having no idea what's being said to it!

3. Launch the official Samsung micro:bit app. Select Connect and then PAIR A NEW MICRO:BIT.

4. Put your micro:bit into pairing mode using by holding A+B and pressing and releasing the reset button, all the time keeping A+B pressed. When "PAIRING MODE" appears, you can release A+B.

5. Complete pairing, following the instructions on the smartphone app.

6. Press reset to restart the micro:bit with the new code. You should briefly see a smiley icon appear and then vanish.

7. Now in the Connect screen, connect to the micro:bit you just paired (select it in the "Connect to previously paired micro:bit" section. After a short delay you should see "C" on the micro:bit. This means a Bluetooth connection was established.

8. Now press button A. This should cause your phone to open the camera app, count down 6 seconds and then take a photo.

Have fun.