OilSlick / kencana_air_sensor

An air sensor for inside a home.
http://blog.michaelcwright.com/2020/07/14/air-quality-sensor/
1 stars 0 forks source link

Gas values printed to serial differ from values sent to io.Adafruit #1

Closed OilSlick closed 4 years ago

OilSlick commented 4 years ago

It could be a problem between float values, word values, bytes, etc.

https://www.thethingsnetwork.org/docs/devices/bytes.html

OilSlick commented 4 years ago

After moving the decimal place of the float, the number becomes too large for a word. Will likely need to convert the float to four bytes:

https://forum.arduino.cc/index.php?topic=246654.0

OilSlick commented 4 years ago

Using a union to convert float to bytes did the trick. Now sending four bytes per float value.