问题
I'm tinkering with an iPhone-controlled RC car chassis that is the base of my robotics project. The chassis is controlled with a WiRC Wi-Fi module. It has eight outputs to control electronic speed controllers and servos.
I'd like to improve my robot's ability to avoid obstacles using sensors. For this purpose, I have an Arduino board which I can interface with various inexpensive rangefinders and proximity sensors. I'm looking for examples or demo projects that would connect an iPhone to an Arduino board using Bluetooth to send commands to the board and receive data from the board. Is what I'm thinking of possible?
Thank you for any links to projects or hardware boards that may interact with an iPhone using Bluetooth. It's great if some of these boards have an SDK to simplify development.
回答1:
Unfortunately, standard Bluetooth communications with devices on iOS is restricted to devices within the MFi program, so you're not going to be able to use that with your Arduino board. However, the new Bluetooth 4.0 LE protocol that is supported in newer iOS devices (iPhone 4S, Retina iPad) is open and can be used to connect any LE device.
iOS 5.0 introduced a new framework for this in Core Bluetooth, and I highly recommend watching the two sessions from WWDC 2012 about this. They also have some sample code on the topic. I've been using this myself to connect to some sensors, and it works well for a low-bandwidth application like temperature, proximity, or heart rate sensing.
There are several BT LE modules out there, and it looks like Dr. Michael Kroll is about to start producing an Arduino shield for LE communication, which would make it trivial to add this kind of capability onto an Arduino board.
回答2:
It's probably a bit late for your project, but the RedBear BLE Shield coupled with an Arduino works great. There is even a robotic truck project built around this combination in Building iPhone and iPad Electronics Projects.
You can access the BLE shield using Objective C, but it's also possible to avoid a Mac entirely and use techBASIC, which lets you program right from the iPhone or iPad.
来源:https://stackoverflow.com/questions/11782221/iphone-any-examples-of-communicating-with-an-arduino-board-using-bluetooth