I'm pretty new to all this. But I'm using 2 different libraries. The output from my sensor is a double and then I'm trying to send this value from my sensor to bluetooth device. But the bluetooth device require a usigned char?
My value could be something like this:
double sensorValue = 22.22
And then I would like to use the value of "sensorValue" like this:
ble_write(sensorValue);
But that's not possible.
I looked into the library and it tells me that it's a unsigned char:
void ble_write(unsigned char data);
So how can I "send" this value from my sensor to my bluetooth device?
I'm pretty new to all this. But I'm using 2 different libraries. The output from my sensor is a double and then I'm trying to send this value from my sensor to bluetooth device. But the bluetooth device require a usigned char?
My value could be something like this:
double sensorValue = 22.22
And then I would like to use the value of "sensorValue" like this:
ble_write(sensorValue);
But that's not possible.
I looked into the library and it tells me that it's a unsigned char:
void ble_write(unsigned char data);
So how can I "send" this value from my sensor to my bluetooth device?
Thanks for your reply I appreciate that. But when I'm trying to do this, I got the following error: "expected constructor, destructor, or type conversion before '(' token" regarding this line:
dtostrf(likeDuck, 8, 4, buff);
Well, mlx.readObjectTempC() most likely does not return an unsigned char, so pretending that it does and being surprised when it doesn't is silly.
Yeah, I know that. Trust me, I've tried many different things. It was just a silly try from a newbie to illustrate what I was trying to do.