OpenCores
URL https://opencores.org/ocsvn/mips32r1/mips32r1/trunk

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Software/] [demos/] [XD3_I2C/] [src/] [app/] [app.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayersg
#include "drivers/piezo.h"
2
#include "drivers/lcd.h"
3
#include "drivers/monitor.h"
4
 
5
int main(void)
6
{
7
        static volatile char count = 0;
8
        uint32_t temperature;
9
 
10
        Piezo_play(C5);
11
        Monitor_start();
12
        LCD_clear();
13
        LCD_setPos(16);
14
        LCD_printString("Temp:");
15
 
16
        while (1) {
17
                // Get Monitor temperature
18
                temperature = Monitor_readTemp(1);
19
                LCD_setPos(22);
20
                LCD_printByteDec((uint8_t)temperature);
21
                LCD_printByte('/');
22
 
23
                // Get CPU temperature
24
                temperature = Monitor_readTemp(0);
25
                LCD_printByteDec((uint8_t)temperature);
26
                LCD_printByte(0xdf);    // degree symbol
27
                LCD_printByte('C');
28
                LCD_printByte(' ');
29
                LCD_printByte(' ');
30
 
31
                // Display a rolling value so we know we're alive
32
                LCD_setPos(31);
33
                LCD_printByte(count);
34
                count++;
35
        }
36
 
37
        return 0;
38
}
39
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.