Project

General

Profile

Statistics
| Branch: | Revision:

pse-2015-16-grupo-3 / tpf / display.c @ 688c8ab5

History | View | Annotate | Download (1.09 KB)

1
#include "display.h"
2
#include "tempo.h"
3
#include <stdlib.h>
4
#include <stdio.h>
5
#include <lcd.h>
6
#include "config.h"
7

    
8
uint8_t setDisplay(pse_time_t clock, int uint8_t power ,char[] Message)
9
{
10
    int lcdHandler;
11
    uint8_t result;
12
    if(getLCDHandler(&lcdHandler)!=0)
13
    {
14
         result=1;
15
    }else{
16
    
17
    char horas[15];
18
    char minutos[15];
19
    char segundos[15];
20
    char Power[15];
21
    sprintf(horas, "%d", tempo.horas);
22
    sprintf(minutos, "%d", tempo.minutos);
23
    sprintf(segundos, "%d", tempo.segundos);
24
    sprintf(Power, "%d", power);
25
    result=0;    
26
    if(Message)
27
    {
28
       
29
        lcdPosition (lcdHandler, 0, 0) ; lcdPuts (lcdHandler,horas+":"+minutos+":"+segundos+"  "+Power+" W") ;
30
        lcdPosition (lcdHandler, 0, 1) ; lcdPuts (lcdHandler,Message) ;
31
        
32
        
33
    }else{
34
        
35
        lcdPosition (lcdHandler, 0, 0) ; lcdPuts (lcdHandler,horas+":"+minutos+":"+segundos+"  "+Power+" W") ;
36
        
37
        
38
        
39
    }}
40
    
41
    
42
    
43
    //power
44
            
45
            
46
    //Message
47
            
48
    
49
    return result;
50
}
51

    
52
uint8_t clearDisplay()
53
{
54
    return 0;
55
}