For this project you will need
an Arduino (we'll use the Leonardo)
an iPhone 4s, 5, iPad 3, 4, mini, or an iPod Touch 5th generation.
Bluetooth Low Energy Shield from Red Bear Labs (http://redbearlab.com/bleshield/)
4 or 5 LEDs
a momentary push switch
a bread board or proto-shield
Red Bear lab's provide an app in the App Store that is general purpose enough to get your BLE-compaitble ios device talking to the shield, but what if we want to take it a little farther, and write our own custom app? Well thats what we are going to cover today.
NOTE!!! TO RUN A CUSTOM APP ON YOUR IOS DEVICE THAT IS NOT IN THE APP STORE YOU WILL NEED TO BE ENROLLED IN THE IOS DEVELOPER PROGRAM WITH APPLE. it is $100 dollars and is not not covered in this tutorial.
Step 1: Wire up the Arduino.
The BLE shield uses Pin 8 and 9 to do its stuff, so its a good idea to leave those alone.
the positive terminals from our LEDs will be going to the following pins on the Arduino
3, 5, 6, and 10
The negative terminals will all go to a common ground. I did not use any resistors in my project, depending on which LEDs you use, you may want to include them.
I'm using on of the LEDs on my proto-shield connected to pin 4 on the Arduino to indicate connectivity with the phone, and one of the toggle switches connected to pin 7.