summaryrefslogtreecommitdiffstats
path: root/humidity_sensors/app/main.c
blob: 6c9e602992e5797ced76ab3fcde3f2f8009b05db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "project.h"

void
main (void)
{
  u8 c;

  clock_init();

  uart_init();
  i2cb_init();

  awu_init();

  sht20_reset();


  enableInterrupts();

  for (;;) {
    sht20_setup();

    printf ("$SNTHD,%s,%s\n", sht20_temp_s(), sht20_humid_s());

    while (!uart_rx (&c)) {
      if (c == 'R')
        sht20_reset();
    }

    delay_ms (10);
    halt();
    delay_ms (10);
  }
}