|
@@ -45,20 +45,32 @@ void main(void)
|
|
|
/* Board Configuration */
|
|
|
boardInit();
|
|
|
Delay(1000);
|
|
|
- LedDigits[3] = led_O;
|
|
|
- LedDigits[7] = led_H;
|
|
|
|
|
|
/* I2C Configuration */
|
|
|
i2c_init();
|
|
|
AHT20_Init();
|
|
|
|
|
|
+ LedDigits[3] = led_O;
|
|
|
+ LedDigits[7] = led_H;
|
|
|
/* Infinite loop */
|
|
|
while (1) {
|
|
|
AHT20_StartMeasure();
|
|
|
+ LedPoint[1] = 0;
|
|
|
+ LedPoint[5] = 0;
|
|
|
Delay(450);
|
|
|
- AHT20_GetData(&Sensor);
|
|
|
- showT();
|
|
|
- showH();
|
|
|
+ if (AHT20_GetData(&Sensor)) {
|
|
|
+ LedDigits[0] = led_Minus;
|
|
|
+ LedDigits[1] = led_Minus;
|
|
|
+ LedDigits[2] = led_Minus;
|
|
|
+ LedDigits[4] = led_Minus;
|
|
|
+ LedDigits[5] = led_Minus;
|
|
|
+ LedDigits[6] = led_Minus;
|
|
|
+ } else {
|
|
|
+ showT();
|
|
|
+ showH();
|
|
|
+ }
|
|
|
+ LedPoint[1] = 1;
|
|
|
+ LedPoint[5] = 1;
|
|
|
Delay(450);
|
|
|
}
|
|
|
|