The Arduino, BLE Shield, and servo should already be fully assembled as shown in the image below:
Arduino Servo Project Completed!
Arduino Servo Project Completed!
Plug the USB cord into the Arduino to supply power. Next make sure your iPhone’s Bluetooth is on and your iPhone is connected to your computer.
Run your app from Xcode; within a couple seconds you should see the app’s Bluetooth icon change from Disconnected to Connected and the BLE Shield’s LED should illuminate. Now move the slider up and down. You should see the servo motor rotate based on the slider movement.
(Here’s a direct link to the QuickTime movie file if you can’t see the above action video.)
Where To Go From Here?
You can download the final project here; it includes both the iOS and the Arduino code.
Hopefully this project has spurred you to dream up other projects that use Bluetooth LE devices and iOS. For example, you could use this tutorial’s servo motor to automatically unlock the front door of your house. Or, you could create an iOS remote control for your water sprinklers and never forget to water your lawn again!
This project gave you a small taste of what it takes to create your own BLE device. If you’re interested in learning more about this topic, you might enjoy my book Integrating iOS Bluetooth LE with PIC18 Microcontrollers. It gives an in-depth look at creating a BLE device at the microcontroller level.
As well, the book provides practical lessons on how to program and configure your own Services and Characteristics for machine control. The main project of the book is based on the iO Xtreme PCB. The book and the iO Xtreme board are available on my website at www.back-40.com.
I hope you enjoyed the tutorial. If you have any questions or comments, please join the discussion in the forums!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.