Hello, and sorry for a maybe very beginner question.
I’m trying to decode my readings from my temperature sensor. the Arduino code is
float temperature = sensors.getTempCByIndex(0);
int16_t temp = (temperature * 100);
Serial.println(temp);
modem.beginPacket();
modem.print(temp);
I can see the right payload in HEX on the ‘live data’ site, but cant seems to figure out how to decode it in the payload formatter.
function Decoder(bytes, port) {
var decoded = {};
if (port === 2)
{
decoded.temp = (bytes[1] << 8) + bytes[0];
}
return decoded;
}
This is the only example I could find of someone doing something similar, but it returns numbers with no meaning to me.
Thanks in advance