-
Notifications
You must be signed in to change notification settings - Fork 55
Arduino port Bluetooth Radio
The Arduino library used for integration with wiselib will be in the lite branch
git clone git://github.com/ibr-alg/Arduino.git
cd Arduino
git checkout lite
The Bluetooth library needs SoftwareSerial library which is already included within this repo.
-
Hardware Requirements
-
2 Bluetooth Bees (You could also use alternatives which are supported by the Arduino Wireless Shield). But you'll have to make changes to the string commands for setting them up as master & slave, and other configuration according to the module you use. I have only tested it for the seeedstudio module)
-
Configuration
Before testing, you need to configure the bluetooth bees, one as master and the other as slave. You can find the appropriate sketches for the purpose here
The example apps for testing the bluetooth modules are in the folder wiselib.testing/apps/arduino_apps/bluetooth_radio_master_app
and wiselib.testing/apps/arduino_apps/bluetooth_radio_slave_app
For this particular module, the pins Rx(0) and Tx(1) that provide HardwareSerial need to be bent (i.e. disconnect them from the arduino) and they need to be externally connected to two other pins on the shield (The default settings used right now will work when pin 8 is connected to pin 0 and pin 9 to pin 1. You can change these in the arduino_types.h
file by changing the macros RXD
and TXD
)
Right now, the module uses a baud rate of 9600
so that Serial monitor can be easily used for debugging. This baud rate is set for the bluetooth bees by the configuration files. If you wish to use another baud rate, you need to change +STBD=9600
in the bluetooth_setup_master.ino
and bluetooth_setup_slave.ino
to +STBD=<desired baud rate>
, and set the same desired baud rate in the arduino_bluetooth_radio.h
for the enum BAUDRATE
.
Update the paths in the Makefile and make the necessary changes to use the PORT
which could be /dev/ttyUSB#
or /dev/ttyACM#
based on your machine.
Running make
from within the app's folder loads the program to the arduino.