Wednesday, 16 November 2016

micro:bit support

The 'micro:bit foundation' has arrived and is charged with looking after the future of the micro:bit. It's also a great place to go for technical support. We've lacked a central place to find answers to questions or to get assistance until now, so this is a big step forwards.

Here are some handy support resources for you:

1. If you need help with a Bitty Software application or tutorial

Send a message to @bittysoftware on Twitter. If you can, post more extensive details on a blog or similar and include a link to these details in your tweet.

2. Anything else micro:bit related

Email or go to and open a support ticket.

That's it!

Tuesday, 15 November 2016

micro:bit Blue - open source at last!

Most of the micro:bit demos involving a smartphone shown on my micro:bit page involve an Android application I wrote and which I eventually decided to call "micro:bit Blue". It was initially put together to help me to test the Bluetooth profile I'd designed for the micro:bit. Then, as I started to have ideas, it transformed into a series of demos.

But I always had the aim that it be released as open source, so I also did my best to provide educational documentation in the helps screens so that people who are new to Bluetooth could get the hang of the primary concepts.

A few months ago I loaded the application into Google Play so that other people could find and install it easily.

 It's right here:

Meanwhile, releasing the source code was delayed by a variety of rather uninteresting issues. And then some more. To cut a long story short and at the same time apologise for having taken so long over this, today I'm delighted to say that the source code is now available!

The new microbit foundation have kindly offered a home for the code and their home being more palatial than my own github home, I gratefully accepted their offer.

I hope those people who have been waiting for this are pleased and that everyone and anyone with an interest in writing smartphone apps for the micro:bit finds this useful.

Here it is:

 Enjoy :-)

Thursday, 10 November 2016

Bitty Data Logger V1.2.0

Yesterday, Bitty Software released a new version of the Bitty Data Logger application. If you're unfamiliar with the app, check it out at the Bitty Software web site.

The new release makes the following improvements:

  1. A new "Results" screen lists up to 30 data files.
  2. Data can now be uploaded at any time.
  3. New "Extra Data" screen provides the opportunity to add a time and distance value after a test run has completed. A speed value is automatically calculated.
  4. The Activate / Deactivate button is now named Start / Stop and is coloured green and red.
  5. The Settings screen now allows a Project Name and a Team Name to be entered.
Bitty Data Logger is currently being evaluated for use in the Bloodhound model rocket car competition for schools, Race for the Line. This is of course, *very* exciting!
Bitty Data Logger is free and available for both iOS and Android. The code needed for the micro:bit is available as a hex file from the Bitty Software web site or you can create it yourself, with guidance available in the form of a couple of coding tutorials, one for C/C++ and one for the PXT tool.

The application is great for school or personal projects:
Spice up your science lessons with the @bittysoftware #microbit data logging app for Android & iOS: #edchat

Here are some screenshots of the new release. 

Ready to start data logging!

And we're off....

After capturing data we can record extra, optional data

Up to 30 data files are kept. NEW files have not yet been uploaded
After uploading, you can download to your computer from the URL provided

Data file details include the URL which was allocated when uploading

Tuesday, 1 November 2016

micro:bit proximity beacons

One the big growth areas for Bluetooth is in "beacons". Bluetooth beacons broadcast data which can be used by another device to deduce roughly where it is. This can be in terms of a particular location or perhaps in terms of proximity to an object of interest.

ABI predict that by 2020, there will be 400 million Bluetooth beacons shipping each year.

Beacons work by using Bluetooth "advertising" to broadcast a small amount of data, which can be received and acted upon by anyone in range with a suitable device and software, typically a smartphone and application.

There are various beacon message formats, which define the way Bluetooth advertising packets are used as containers for beacon data. iBeacon is Apple's beacon message format. Eddystone comes from Google.

Google have a very interesting project called the Physical Web and it in large part, is all about how Bluetooth beacon technology, coupled with software on smartphones and tablets, coupled with the web, can enable people to more easily discover and interact with physical things in the environment.

Believe me. This is going to be BIG.

I just helped add Eddystone beacon capabilities to the BBC micro:bit. Kudos to Thomas Beverly for having kicked things off by implementing support for Eddystone URL messages in the micro:bit's "runtime". I tagged along for the ride and added support for UID messages over the weekend and it's now pretty easy to use a micro:bit for a wide range of beacon scenarios.

I have a couple of videos on my Bitty Software web site. The first shows the UID Eddystone message type in use and the second uses the URL message type. Take a look at them now to get the idea, especially if you're not already familiar with beacons.

Don't forget, you don't need to make a Bluetooth connection to a beacon to use it... you just have to be near enough to it to receive its broadcast data and as I've noted elsewhere in this blog, micro:bits can have a range of hundreds of metres when using Bluetooth at full power. 

So you could place micro:bit beacons all over (say) your school, and with a suitable application on phones and tablets, provide information pertinent to each location or some other response, automatically on someone simply coming into range of the micro:bit's beacon broadcasts.

Right now, turning your micro:bit into a beacon requires you to do some C/C++ programming. I'm hoping though that Microsoft's awesome PXT tool will end up with a "Bluetooth Beacon Block" in the future so that making micro:bit beacons is as easy as can be.

The microbit-samples repo will soon have Eddystone beacon code examples in it and I've also submitted updates to the Lancaster University micro:bit documentation on the subject.

Meanwhile, to whet your appetite, here's some code:

#include "MicroBit.h"

MicroBit uBit;

char URL[] = "";
const int8_t CALIBRATED_POWERS[] = {-49, -37, -33, -28, -25, -20, -15, -10};

uint8_t advertising = 0;
uint8_t tx_power_level = 6;

void startAdvertising() {
    uBit.bleManager.advertiseEddystoneUrl(URL, CALIBRATED_POWERS[tx_power_level-1], false);
    advertising = 1;

Saturday, 29 October 2016

Bitty Software

Bitty Software is a relatively new endeavour which concentrates on smartphone apps for use with the BBC micro:bit and offers free coding tutorials where you can learn to write the micro:bit code which is needed to make a micro:bit work with one of the Bitty Software apps. Tutorials are available for both C/C++ developers and those who prefer a visual programming language. In the latter case, Microsoft's excellent PXT is used.

The ethos behind Bitty Software is that in this emerging age of IoT, learning to code is just one dimension of the technology journey which youngsters need to take; learning about connectivity and communications is essential too. Hence the focus on systems which involve one or more micro:bits, a smartphone or tablet and in the middle, enabling the whole thing to work, Bluetooth.

Despite being such a relatively new concern, the Bitty Software web site is rapidly accruing a really useful collection of micro:bit programming resources, including some great videos.

Take a look.... the bitty data logger application demo and the micro:bit Eddystone beacon demos are particular favourites.

Bitty Software already have 4 applications for micro:bit, all of which are available for both iOS and Android. There are more in the pipeline. Watch this space!

Bitty Data Logger and a Speeding Vehicle

I thought it would be interesting to see how well the new Bitty Software application Bitty Data Logger would handle capturing accelerometer data from a micro:bit attached to a moving vehicle. So.... that's what I set out to discover.

The first challenge was how to attach a micro:bit to my car! I'm no structural engineer. As you'll see. But with some good sticky tape, some glue, some rolled up cardboard and of course a piece of Lego, anything's possible :-)

There were some practical issues associated with planning this project. One person would need to drive and another hold the smartphone and operate the app whilst standing at the side of the road. I'd need a suitable stretch of road where I could drive fairly fast without breaking the law or having a horrible accident. And of course "smartphone operator" and driver would need to be able to communicate so that the driver would know when the app was connected to the micro:bit and data capture activated in the the bitty data logger app.

My long suffering wife got the job of smartphone operator, with me behind the wheel of my car. We'd devised a system of hand signals she could use to indicate she was ready and I could start driving (none of which were rude!) and I dropped her at a suitable point on a local A road, drove to the end of the road and came back around the roundabout ready to drive past her. I awaited her signal as she scanned for and connected to the micro:bit mounted on my car's wing mirror and activated data logging.

When the signal came, I immediately put my foot down and accelerated up the road in her direction. For about 2 seconds. I immediately got stuck behind another car. Yes, there was a lot of traffic about, and I did wonder what effect all those large metallic objects might have on Bluetooth radio communications.

I pulled out past the slower vehicle and put my foot down again. About 2 seconds later I was at 60mph and held that speed until the next set of traffic lights forced me to decelerate.

Don't worry - this was taken by my passenger before we started data logging!

Had the experiment worked? Had we captured any data?

Happily the answer was a big yes! The plan had been for my wife to start capturing data when I was at the roundabout about 50 metres away and driving towards her and then deactivate when I was an estimated 100 metres past her. It looks like everything worked a treat. Here's the resultant data in chart form with a manually drawn trend line which shows broadly how things panned out.

Y axis - forward acceleration

Note that this data is completely raw. The micro:bit accelerometer generates data that is somewhat "rough" and it's best used by applying a low pass filter to it to smooth out its roughness. Maybe a later release of Bitty Data Logger will give you the option to have it do this for you.

I was predominantly interested in the Y axis which represents forward motion, given how I'd mounted the micro:bit on my car, but just for good measure, here's the X (sideways) and Z (up and down) data:

X axis - sideways acceleration
My guess is, the sudden deceleration and then acceleration shown near the start of the chart correspond to me having to pull out and overtake the car that was blocking my way. After that, the general trend shows constant x axis acceleration, averaging around 0.

Z axis - up and down acceleration
The Z axis just shows vibration and general bumpiness I think!

I think I can declare today's little experiment a success!

Friday, 19 August 2016

How to switch off the need to pair your micro:bit when using Bluetooth

Pairing is the bedrock of all Bluetooth security. If you pair your micro:bit with your phone, for example, from that point on, only you can connect to and interact with your micro:bit. Imagine you were using your phone with my micro:bit Blue application to drive a  micro:bit controlled Kitronik buggy. You wouldn't want someone else connecting to it and driving it away, would you?

But not all applications need security. And pairing definitely impacts user experience. Furthermore, currently, whenever you flash a new hex file to your micro:bit, the pairing data gets wiped off your micro:bit so you have to 'forget' the pairing details on your phone and go through the entire pairing process again. Not great when you're performing develop/test cycles frequently.

Note: some changes are planned in this area. USB firmware is to be changed so that data on micro:bit, including pairing keys, will persist when new hex files are flashed. I'm also aiming to have a Block in Microsoft's PXT that lets you choose whether you want pairing or not and if you do, whether it should be based on the passkey system or Bluetooth's "Just Works" method. Watch this space for updates on both these developments.

If you're a micro:bit C/C++ developer, you can get under the hood in ways in which users of other tools often cannot. And this includes the ability to create a hex file which will result in your micro:bit not needing to be paired. Here's how.

In your project folder's root, you should have a file called config.json. All you need to do is ensure there's a property of the bluetooth json object called 'open' which has a value of 1. open=1 means 'no security'. Here's the first part of my config.json file:

    "microbit-dal": {
        "bluetooth": {
            "enabled": 1,
            "pairing_mode": 1,
            "open": 0,
            "dfu_service": 0,
            "event_service": 0,
            "device_info_service": 1
        "gatt_table_size": "0x700"

And that's it! Run 'yt clean' followed by 'yt build' and the resultant hex file will remove the need for your microbit to be paired when using Bluetooth.

Even with applications that need security, this is useful. You can do development and test cycles with pairing switched off, and enable it when you come to do your final testing and release build. The best of both worlds.

Use responsibly! :-)

Code it. Connect it. Bitty Software.