I am trying to do a project based on Genuino/Arduino 101(CurieIMU) and Android in which I want to get sensors data like accelerometer,gyroscope(x,y and z) and send it to an android app with bluetooth(Integrated BLE).
I don't know how to send/receive it and how to connect the devices with bluetooth low energy.
I don't know how to connect a BLE device but once connected Bluetooth is just "serial by wireless" and the examples in Serial Input Basics may be useful.
...R
Robin2:
I don't know how to connect a BLE device but once connected Bluetooth is just "serial by wireless" and the examples in Serial Input Basics may be useful....R
I just need to send sensor data from arduino with bluetooth (BL) to android, not receive.
Maybe i'm starting to understand how its work...
BLEPeripheral blePeripheral; //declare your ble peripheral
BLEService yourService(serviceUUID);
BLECharacteristic yourConstructor(characteristicUUID, BLEWrite, 20); //To write strings of 20bit ?
void setup() {
Serial.begin(9600);
/* Set a local name for the BLE device*/
blePeripheral.setLocalName("Name");
blePeripheral.setAdvertisedServiceUuid(yourService.uuid()); // add the service UUID
blePeripheral.addAttribute(yourService); // Add the BLE Service
blePeripheral.addAttribute(yourConstructor); // Add the BLE Constructor
blePeripheral.begin();
Serial.println("Bluetooth device active, waiting for connections...");
}
And after that I send my data with:
void updateData() {
//////
float myData = ////;
yourConstructor.setValue(myData, 20); //Send data with bluetooth to another device?
}
Thank you!