Sunday, 23 April 2017

Bitty Data Logger 2.3

A new release of Bitty Data Logger from Bitty Software is now available for both Android and iOS. Check Google Play and the Apple App Store for the update.

This release aims to streamline the process of using the app for Bloodhound Race for the Line competition participants (see http://www.racefortheline.com/). Key data may now be uploaded direct to the Bloodhound leader board after data has been collected.

Changes in this release are:

1. Data logging projects may now be designated as type 'Bloodhound Race for the Line' or 'Other'

2. Results from Bloodhound projects (rocket car races) may be uploaded directly to the Bloodhound Leader Board

3. Minimum and maximum acceleration in X, Y and Z directions are now recorded in results

4. Certain types of data in results may now be edited to correct mistakes prior to upload or posting to the Bloodhound Leader Board

It is recommended that you uninstall Bitty Data Logger and then install the new release from the application store.

That's it

Enjoy



Thursday, 20 April 2017

Making the micro:bit accelerometer available over Bluetooth

Here's a very simple C/C++ application, created using the mbed web IDE.

The project was created in the mbed IDE with the following parameters:

Platform="BBC micro:bit", Template="An example of how to use the micro:bit DAL's abstract....." and Project Name=-"microbit-ble-accelerometer"

All it does is establish event handlers for Bluetooth connect and disconnect events and adds the Bluetooth accelerometer service so that an application like micro:bit Blue or Bitty Data Logger can receive accelerometer data over Bluetooth.

#include "MicroBit.h"

MicroBit uBit;

void onConnected(MicroBitEvent)
{
    uBit.display.print("C");
}

void onDisconnected(MicroBitEvent)
{
    uBit.display.print("D");
}

int main()
{
    // Initialise the micro:bit runtime.
    uBit.init();

    // Insert your code here!
    uBit.display.scroll("X");
    
    uBit.messageBus.listen(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_CONNECTED, onConnected);
    uBit.messageBus.listen(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_DISCONNECTED, onDisconnected);

    new MicroBitAccelerometerService(*uBit.ble, uBit.accelerometer);

    // If main exits, there may still be other fibers running or registered event handlers etc.
    // Simply release this fiber, which will mean we enter the scheduler. Worse case, we then
    // sit in the idle task forever, in a power efficient sleep.
    release_fiber();
}


I also set MICROBIT_BLE_OPEN to 1 in microbit-dal/inc/core/MicroBitConfig.h so that pairing is not required. Much easier for testing purposes.

#define MICROBIT_BLE_OPEN                       1

After compiling to produce a hex file, copy the hex file onto your micro:bit. An application like nRF Connect on a smartphone or tablet should see a Bluetooth service with UUID which starts 0xe95d0753-. This is the accelerometer service. Enabling notifications on the first characteristic (Accelerometer Data) will result in its value updating when you move the micro:bit.

The project has been published here:

https://developer.mbed.org/users/bluetooth_mdw/code/microbit-dal-ble-accelerometer-example/