|
@@ -45,6 +45,9 @@ void main(void)
|
|
|
{
|
|
|
/* Board Configuration */
|
|
|
boardInit();
|
|
|
+ Delay(1000);
|
|
|
+ LedDigits[3] = led_O;
|
|
|
+ LedDigits[7] = led_H;
|
|
|
|
|
|
/* I2C Configuration */
|
|
|
i2c_master_init();
|
|
@@ -63,28 +66,22 @@ void main(void)
|
|
|
|
|
|
/* Private functions ---------------------------------------------------------*/
|
|
|
static void showT(void) {
|
|
|
- int16_t t;
|
|
|
+ int16_t t = (Temperature + 5) / 10;;
|
|
|
uint8_t a;
|
|
|
- if (Temperature > 0) {
|
|
|
- LedDigits[0] = LED_OUT_PL;
|
|
|
- t = (Temperature + 5) / 10;
|
|
|
- } else {
|
|
|
- LedDigits[0] = LED_OUT_MM;
|
|
|
- t = ((Temperature + 5) / 10) * -1;
|
|
|
- }
|
|
|
- LedDigits[1] = t / 100;
|
|
|
+
|
|
|
+ LedDigits[0] = t / 100;
|
|
|
a = t % 100;
|
|
|
- LedDigits[2] = a / 10;
|
|
|
- LedDigits[3] = a % 10;
|
|
|
+ LedDigits[1] = a / 10;
|
|
|
+ LedDigits[2] = a % 10;
|
|
|
}
|
|
|
|
|
|
static void showH(void) {
|
|
|
uint8_t a;
|
|
|
- LedDigits[4] = LED_OUT_H;
|
|
|
- LedDigits[5] = Humidity / 100;
|
|
|
+
|
|
|
+ LedDigits[4] = Humidity / 100;
|
|
|
a = Humidity % 100;
|
|
|
- LedDigits[6] = a / 10;
|
|
|
- LedDigits[7] = a % 10;
|
|
|
+ LedDigits[5] = a / 10;
|
|
|
+ LedDigits[6] = a % 10;
|
|
|
}
|
|
|
|
|
|
static void boardInit(void) {
|