diff options
author | fishsoupisgood <github@madingley.org> | 2021-01-24 09:23:12 +0000 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2021-01-24 09:46:06 +0000 |
commit | fb71edfb6bc0702aa2ee1cc73d0822bbc37674ad (patch) | |
tree | 03fe3d9401f8050f90426316bbc665077d228591 /humidity_sensors/app/main.c | |
parent | 2647a6052f0dfeeedfd4127971afc60c331dda7d (diff) | |
download | heating-fb71edfb6bc0702aa2ee1cc73d0822bbc37674ad.tar.gz heating-fb71edfb6bc0702aa2ee1cc73d0822bbc37674ad.tar.bz2 heating-fb71edfb6bc0702aa2ee1cc73d0822bbc37674ad.zip |
working-ish sensor
Diffstat (limited to 'humidity_sensors/app/main.c')
-rw-r--r-- | humidity_sensors/app/main.c | 27 |
1 files changed, 27 insertions, 0 deletions
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); + } +} |