Simple Bluetooth Example. Arduino increments a counter and sends the value over Bluetooth. Android phone displays the value.
Some assembly required.
I'll assume you've cloned https://github.com/don/BluetoothSerial into ~/BluetoothSerial
Copy the chat example to a new directory.
$ cp -R ~/BluetoothSerial/examples/Counter ~/Counter
You need to copy the project to a new directory, otherwise the plugin installer will fail.
Hardware
- Arduino Uno
- Bluetooth radio that support Serial Port Protocol (SPP)
Upload the sketch to your Uno using the Arduino IDE.
Pair your Android phone with the bluetooth adapter.
$ npm install cordova -g
This assumes you have the Android SDK installed and $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools in your system path
Edit assets/www/js/index.js and change the Mac Address to match the address of your Bluetooth modem.
$ cordova platform add android
$ cordova plugin add cordova-plugin-bluetooth-serial
Compile and run the application
$ cordova run android