From fb71edfb6bc0702aa2ee1cc73d0822bbc37674ad Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Sun, 24 Jan 2021 09:23:12 +0000 Subject: working-ish sensor --- humidity_sensors/app/main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 humidity_sensors/app/main.c (limited to 'humidity_sensors/app/main.c') diff --git a/humidity_sensors/app/main.c b/humidity_sensors/app/main.c new file mode 100644 index 0000000..a94d681 --- /dev/null +++ b/humidity_sensors/app/main.c @@ -0,0 +1,27 @@ +#include "project.h" + +void +main (void) +{ + u8 c; + + clock_init(); + + uart_init(); + i2cb_init(); + + sht20_reset(); + + //enableInterrupts (); + + for (;;) { + printf ("$SNTHD,%s,%s\n", sht20_temp_s(), sht20_humid_s()); + + while (!uart_rx (&c)) { + if (c == 'R') + sht20_reset(); + } + + delay_ms (1000); + } +} -- cgit v1.2.3