No answers yet but I'm looking for a solution too. I've got this code to read Bluetooth on an iPad but it says it may not working with BLE devices (low powered)
Here's a link to arduino code for BLE devices...
I need to know how to wire it up to my Arduino first and foremost.
Based on the other HC-05 unit...
... I'm assuming I wire up the GND -> GND, VCC -> 3.3 or 5V (don't want to get that one wrong) TX -> RX and RX -> TX all on the Module. for example TX - > RX means Arduino (TX) to ZBModule (RX)
Also handy tip... when you upload code from the Arduino Sketch app to the Arduino board - unplug the RX and TX while you do this as you get weird errors. Just plug the RX and TX back in afterwards.
I don't know much about your specific board, but I was able to find a "learn" page:
It has some example code, and a test that looks like it opens a connection and loops back. BLE can be a bit tricky when connecting to phones/tablets, I recommend checking out the Cypress CySmart app from either the app store or play store. It lets you "peek" at BLE devices, open connections and view the GATT attributes. this can be very helpful when debugging BLE connections.
I've also found a nice and simple Arduino to Android tutorial. While it's not iOS it helps troubleshoot the bluetooth connection (if you have an android as well that is)
I wish Apple had something like CodeBlocks/AppInventer
...which finds the BLE device and connects to it (makes it visible) - then you will see it connected in the Bluetooth section in Settings on the iPad - not sure why it doesn't come up normally with iOS. Now it's connected the light doesn't flash repeatedly - it flashes once per 3 seconds.
The shield sits on the top (obvious when you think about it) just line the pins up and plug it in. It's basically extending the connectivity of the Arduino while still having the ZModule attached. See pic. I've attached an LED to Pin 13 and GND.
The code below is sitting on the Arduino waiting for a serial string from the iPad (still writing that bit)
int ledPin = 13; // LED light is on PIN 13
String readString;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop()
{
while ( Serial.available() )
{ // While there is data in the buffer
delay( 3 );
char c = Serial.read(); // reads characters sent from the Android app to Bluetooth module
readString += c; // build the string - “on” or “off”
}
if ( readString.length() >0 ) // only reads on/off if string length is more than 0
{
Serial.println( readString );
if ( readString == "on" ) // if string is on, then turn LED on
{
digitalWrite(ledPin, HIGH) ;
}
if ( readString == "off" ) // if string is off, then turn LED off
{
digitalWrite(ledPin, LOW );
}
readString=""; // sets string to empty so that it has length of 0 and maintains current light state until string is more than 0
}
}