0

I'm new to Arduino and I'm struggling to find a way to send integer value from the Bluefruit Feather 32u4 to my desktop app. I'm trying to send data through my BLE connection like this:

int value = 300;
ble.println(value);

However, I think that this function isn't for that, cause in the desktop app, what I get is a string. The code I wrote for that BLE client was based on the example provided by Microsoft (available here). Any suggestions on what should I be doing to send integer values from the Arduino device to the desktop?

dda
  • 6,030
  • 2
  • 25
  • 34
  • 1
    You might want to try `write()` instead, but be aware that you might have to deal with several technical issues, e.g. *different architecture endianness* and *different variable size*. Even if it works on your own machine without much effort, *portability* is still an issue since it might not work on others. *String-based* data exchange is good enough for most applications, since it avoids unnecessary complexity. – Patrick Trentin Feb 22 '17 at 03:56
  • Thank you for your reply! But in this case I'm worried with performance too, cause I'll need to send a stream of data. I don't believe that sending strings will be the best in this scenario. – Gilliano Menezes Feb 22 '17 at 14:05
  • fine, mine was only a suggestion. :) – Patrick Trentin Feb 22 '17 at 14:16

0 Answers0