-
Follow https://learn.adafruit.com/bluefruit-le-python-library/installation to install adafruit bluetooth library. If you need to follow the install pyobjc step here, then make sure to use the
easy_install
instructions and not thepip
ones. -
Install pyosc:
sudo pip install pyosc
-
Make sure bluetooth module is in CMD not DATA
-
If not using serial, comment out line in sketch at start of
setup
that saysCOMMENT THIS OUT WHEN NOT USING SERIAL
.
-
Start your devices.
-
Open max
-
Run the following terminal command:
% python ./bluefruit_osc_bridge.py
The order you start max, arduino, and python should not matter.
There are three files here:
-
An arduino sketch called
bluedust
. Inside the sketch directory, there is also a header file,BluefruitConfig.h
with some basic configuration information. This file will need to continue to be side by side with the.ino
file. -
A very simple proof of concept max patch called
udp-example.maxpat
that listens for data from two different devices over OSC and prints their values to the console. -
A python script
bluefruit_osc_bridge.py
that does the bridging between bluetooth and max via OSC.
The arduino file has a block inside of the loop
function marked with a comment that will need to be changed to send your sensor reading instead of the character "A".