consulting_code
Joined: 08 Jun 2013 Posts: 2
|
problem with LCD display |
Posted: Sat Jun 08, 2013 5:06 pm |
|
|
hello, i'm trying to do a code for an alarm clock that works with DS1302 and the alarm is set off by a temperature sensor (LM35)
my code is working ok, but the problem is that the LCD displays the clock in hexadecimal, and i need it in decimal
can somebody please help me?
Code: |
void horas(void){
byte x=0;
printf(lcd_putc,"\fConf.hora:\nHora: %2X:%2X:%2X",hour,min,sec);
while(x==0){
if(input(PIN_D6)==1){
delay_ms(500);;
hour++;
switch(hour){ //limites...
case 0x0A: hour=0x10;break;
case 0x1A: hour=0x20;break;
case 0x24: hour=0x00;
}
printf(lcd_putc,"\nHora: %2X:%2X:%2X",hour,min,sec); //muestra por lcd min
}
if (input(PIN_D3)==1){
x++;
output_toggle(PIN_D0);
}
}
}
|
|
|