Skip to content

vedes/testBT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhoneGap Arduino LED Example

Control LEDs on the Arduino from your Android Phone.

Blue Lights

Green Lights

This is the example code from my PhoneGap for Makers talk at the 2013 Maker Faire Bay Area.

Arduino

Hardware

TODO Fritzing diagram here

Android

Upload the sketch

Upload the sketch to your Uno using the Arduino IDE.

Pair your phone

Pair your Android phone with the bluetooth adapter.

PhoneGap - Android

This assumes you have the Android SDK installed and $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools in your system path.

Adding platforms generates the native project

$ cordova platform add android

Install the Bluetooth Serial plugin with cordova

$ cordova plugin add cordova-plugin-bluetooth-serial

Connect your phone to the computer.

Compile and run the application

$ cordova run

After the application starts, connect bluetooth by touching the "Connect" label. Occasionally it takes a few times to connect. Watch for the green connect light on the Bluetooth adapter.

Move the sliders to adjust Red, Green, and Blue values.

iOS

This code also works with iOS as long as you use a RedBearLabs BLE radio or the Adafruit Bluefruit LE

For the RedBear radios upload the PhoneGapLED.ino sketch to your Uno using the Arduino IDE.

For the Adafruit Bluetfruit LE radio upload the PhoneGapLED_BluefruitLE.ino sketch to your Uno using the Arduino IDE.

Adding platforms generates the native project

$ cordova platform add ios

Install the Bluetooth Serial plugin with cordova

$ cordova plugin add cordova-plugin-bluetooth-serial
$ cordova prepare
$ open platforms/ios/LED.xcodeproj

Build the code and deploy to your iPhone using Xcode

BluefruitLE

About

test bluetooth in cordova

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published