I recently purchased an nRF8001 Bluefruit LE and I am now trying to read/send data with an app. But I am not sure how I can write/send a double value. I want to send two double values at once and to successfully send this, do I have to convert these doubles to a byte array? If so I would very much appreciate how that would look!
This is documentation on how my module works: https://learn.adafruit.com/getting-started-with-the-nrf8001-bluefruit-le-breakout/nrf-uart-in-detail
Under the headline Writing data
they give examples on how to send data but as far as I can see (I am a bit new to Arduino code) in their example they only send an int and a string.
I know how to read and set up the module, so it is only the writing/sending doubles that I am struggling with.
These are the two doubles that I wish to send and I control it with:
double valueOne;
double valueTwo;
The Bluetooth control:
Adafruit_BLE_UART BTLEserial = Adafruit_BLE_UART(ADAFRUITBLE_REQ, ADAFRUITBLE_RDY, ADAFRUITBLE_RST);
So if I for example do this:
BTLEserial.write(valueOne, valueTwo);
I get this message: no matching function for call to 'Adafruit_BLE_UART::write(double&, double&)'
So do I need to convert these two double values to a byte array and if so how would that look?
Appreciate every help, tips, code! :)
Serial.println(gps.location.lat(),6);
?Serial.println(gps.location.lng(),6);
onceSerial.println(F("* Connected!"));
onceSerial.println(F("* Connected!"));
is normal, because the message is sent only when the status change. But are you sure that yourgps.location.isUpdated()
is true ?Serial.println("test");
right at the top of the while loop and that stops once i connect the app with the bluetooth as well so there must be something else.