Hi all,
This is my first imp project and could use some help. I’m using my imp to view temperature and humidity data via an arduino. I’m using this sensor (wired version)
I’ve got the hardware working and arduino code running with no problems (talking via pins 5 and 7 on the imp). My sketch outputs the RH and T values in the arduino serial monitor.
I’m not seeing the same values at the imp node in the planner. I know my code here is not correct.
On page 3 of the sensor data sheet I see there is info about the bits that are transmitted from this sensor (16RH + 16T + 8 checksum). I can’t seem to figure out how to use this info to get them to display correctly, including two decimal points. Any help would be appreciated!
Here’s my imp code:
// UART Read Example
// configure a pin pair for UART TX/RX
hardware.uart57.configure(19200, 32, 8, 1, NO_CTSRTS);
function readSerial() {
hardware.uart57.write(0xC0);
imp.sleep(1);
local result = hardware.uart57.read();
if (result == -1) {
server.show(“No data returned.”);
} else {
server.show(result);
}
imp.wakeup(1, readSerial);
}
imp.configure(“Serial RX”, [], []);
readSerial();