2014-01-02 02:47 AM
struct tm time;
char year[50]; Guys, I want to display year into LCD screen but I got 00 on LCD, any clues on how to do it ? thanks printf(''Time: %d-%d-%d %02d:%02d:%02d \r\n'', time.tm_year, \ time.tm_mon+1, time.tm_mday,\ time.tm_hour, time.tm_min, time.tm_sec); sprintf(year,''%.2f'',time.tm_year);lcd_string(year); #!complicated
2014-01-06 08:56 AM
Yes, that is the LCD.
Here is the initialization code. It is based on another code from the internet, and uses the SPI peripheral to communicate. I include the SPI init as well. ________________ Attachments : nokia-5110.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I19V&d=%2Fa%2F0X0000000bj5%2FVKpehYu93Kvi94xa4FUCBofrCMc1QLpKsRYbIzrecRw&asPdf=falsespieeprom.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I18s&d=%2Fa%2F0X0000000bj6%2F43wWFSUogljMuXVofE5U.Hgy5E.QC7TQ.lHmtL_pfuM&asPdf=false2014-01-07 01:22 AM
But the problem seems to be that the time structure is not being setup properly so using a new LCD method to display what is already wrong is of no use and further adds to the number of variables to solve (further confusion if any was needed). The original poster needs to cut this down to one problem at a time e.g. loose the LCD for now (UART works so just use that) until the time string is formatted correctly would be a good starting point.
@h.rick you really need to read this carefully: Especially the section entitled ''When asking about code''. Also this issue is cross posted here so you should always at least link to it: http://goo.gl/w27Y72