Install board and blink!

Install Windows 7 Driver

If you are running Windows 7 you need to install this driver.

If you are on Mac, Win 10+ or Linux it is not require! Skip this step

Download Arduino IDE

You will need to use the Desktop IDE. Make sure you are running the latest version.

Install SoftDevice onto SinoBit

Arduino assumes there's a 'softdevice' radio already installed. If you used MicroPython with your sinobit, that softdevice was erased.

Reinstalling it is easy, simply follow the instructions at Sandeep Mistry's instructions. When selecting the programmer, I had success using CMSIS-DAP. I made a point of resetting it to USPTinyISP when the SoftDevice flashing was complete.

Add NRF5x Board Support

The microbit uses the nRF51 which is not 'natively' supported. But its easy to add support!

In Arduino, go to Preferences and add https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json into the Additional Board Manager URL text box.

 

If this is not your first, make sure to separate URLs with a comma.

Open Tools>Board>Boards Manager from the menu bar, search for nRF5 and install "Nordic Semiconductor nRF5 Boards" by Sandeep Mistry

Install the Sino:bit library.

Currently, Sino:bit support is in a separate library but should eventually be included with the nRF5 board support.  For now, we can treat the Sino:bit as a Micro:bit with a bit extra.  The Sino:bit library provides that extra.

The experimental version of the library is at https://github.com/dastels/Sinobit and you can download and install it manually. Just click this button to download the zip:

Rename the uncompressed folder Sinobit and check that the Sinobit folder contains src and example folders.

Place the Sinobit library folder your arduinosketchfolder/libraries/ folder. 
You may need to create the libraries subfolder if its your first library. Restart the IDE.

Select Board and Upload

Select BBC micro:bit from the Boards menu.

Set SoftDevice to S110.

And set the Port to the microbit

And create a new sketch with this blink demo.

#include <sinobit.h>

Sinobit matrix = Sinobit();

void setup() {
  Serial.begin(9600);
  Serial.println("Sinobit is ready!");

  matrix.begin();
  delay(100);
  matrix.clearScreen();
}

void loop() {
  Serial.println("blink!");
  
  // set a pixel
  matrix.drawPixel(0, 0, 1);
  matrix.writeScreen();
  delay(500);
  
  // clear a pixel!
  matrix.drawPixel(0, 0, 0);
  matrix.writeScreen();
  delay(500);
}

Click Upload!

If you get a warning about openocd - approve access so it can upload the code

You should see the top left LED blinking!

Last updated on 2017-12-06 at 04.45.25 PM Published on 2017-12-06 at 04.57.43 PM