Hello everyone, hope you are all doing well.
Currently doing a project in which we have to send data to TTN, we have been able to use the “Hello World” code available online and it worked. Now we are trying to send actual data (in this case humidity values), was trying to use LMIC_f2sflt16
because we found a sample code online but ever since we added that function, it started giving us “Unknown event”.
`float rHumidity = dht.readHumidity();
Serial.print("%RH ");
Serial.println(rHumidity);
// adjust for the f2sflt16 range (-1 to 1)
rHumidity = rHumidity / 100;
// float -> int
uint16_t payloadHumid = LMIC_f2sflt16(rHumidity);
// int -> bytes
byte humidLow = lowByte(payloadHumid);
byte humidHigh = highByte(payloadHumid);
payload[0] = humidLow;
payload[1] = humidHigh;
LMIC_setTxData2(1, payload, sizeof(payload)-1, 0);
`
Any ideas?
Thank you in advance if you reply.
Rodrigo Oliveira