Step #3: Upload the Arduino sketch
Use the Arduino IDE to upload the BluetoothLock sketch from the arduino directory to your board.
- Install Adafruit Bluefruit LE Connect on your iPhone or iPad.
- Launch Bluefruit LE and choose "UART monitor"
- Once connected, you can send data to the Arduino and receive responses.
- Send u12345. The green light should light up and the lock will open.
- Send an invalid code, u2222, the red light will light up.
- Note that the lock will ignore incoming data without the "u" (unlock) prefix.
- If you have an Android device that supports BLE, test the lock using nRF UART.
Step #5: Install PhoneGap
- Go ahead and install PhoneGap (aka Cordova) on your Mac. It isn't going to work with Xcode 5.1, unless you apply patches, so you should probably stuck with Xcode 5.0 if you can.
- Download and install NodeJS, or install it using a package management system like Homebrew or MacPorts.
- Then install Cordova using NPM, which comes with NodeJS.
$ npm install -g cordova
See the Cordova Documentation for more information.
Step #6: Building the PhoneGap project
Step #7: Running the application
Open the application on your iPhone and connect to the lock.