CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

problem with LCD display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
consulting_code



Joined: 08 Jun 2013
Posts: 2

View user's profile Send private message

problem with LCD display
PostPosted: Sat Jun 08, 2013 5:06 pm     Reply with quote

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? Crying or Very sad
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);
}
}
}

Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sat Jun 08, 2013 5:41 pm     Reply with quote

There is not a problem with LCD display.

The CCS manual shows you how to format in decimal rather than HEX.

Look it up.

Mike

Hint: look under printf()
consulting_code



Joined: 08 Jun 2013
Posts: 2

View user's profile Send private message

PostPosted: Sat Jun 08, 2013 6:37 pm     Reply with quote

thank you very much, man
you solved all my problems! Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group