diff options
Diffstat (limited to 'main.c')
-rwxr-xr-x[-rw-r--r--] | main.c | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -20,20 +20,36 @@ #include "board.h" #include "delay.h" +#include "lcd.h" #include "temp.h" -void main(void) +#include <stdio.h> + +int main(void) { // Prepare processor and IO boardInit(); delayInit(); + _NOP(); __enable_interrupt(); - // Prepare temperature sensor - //if (tempInit() != 0) - // while (1); // Sensor error, halt + lcdInit(); + + if (tempInit() != 0) { + lcdPuts("Sensor broken."); + while (1); + } + + char buf[8]; + while (1) { + lcdClear(); + int16_t temp = tempGetDieTemperature(); + sprintf(buf, "%04d", temp); + lcdPuts(buf); + delay(1000); + } - while (1); + return 0; } |