Page 1 of 1

Bluetooth via I2C - working!

Posted: Wed Sep 30, 2015 3:15 pm
by mikerr
One thing missing from codebug as a wearable is bluetooth ...

I have been playing with a bluno beetle -a tiny £10 arduino board with built in bluetooth.
..and it is tiny - smaller than a codebug:


Both codebug and arduino support I2C - although codebug only currently as a slave using the i2c_tether firmware.

I've connected them via I2c and they can talk (codebug is at 0x18) and the bluno is powered from the codebug.

... next step is to find out the raw commands/bytes

- currently delving through the python library at

Re: Bluetooth via I2C working !

Posted: Fri Oct 02, 2015 10:25 am
by mikerr
Success !

A bluetooth controlled codebug !

I can type a letter on the phone, and the codebug displays it


Note the bluetooth part is handled by the bluno beetle itself,
the I2C could be used with any arduino.

Arduino code (reduced for clarity):

Code: Select all

#include <Wire.h> 

int ROUTINE_SET =  3;

int LED_LINE = 1; // row number, can be set to rows 0 - 4
int LINE_VALUE = 0b11000; // 5 bit representation of LEDs in a row

error = Wire.endTransmission();

full arduino code on github (work in progress)

Makes a nice blutooth connected wearable...

Re: Bluetooth via I2C - working!

Posted: Fri Oct 02, 2015 2:48 pm
by BMS Doug
I'm guessing that the arduino code is just C and therefore could be easily adapted as a C library for use on the Pi as well? (for those people who would rather use C than Python).

Re: Bluetooth via I2C - working!

Posted: Fri Oct 02, 2015 3:55 pm
by mikerr
Yes, arduino is mainly C (it has elements of C++ too)

On Pi, there are ways of directly calling the supported codebug python i2c library from C ... spberry-pi

Re: Bluetooth via I2C - working!

Posted: Mon Nov 09, 2015 2:49 pm
by mikerr
Someone on twitter asked for more info , so here's a pic of where I soldered a pin header onto the I2C pads of the bluno beetle for easier connection:


Then SCL/SDA and GND are connected to same pins on codebug.