??? 03/10/05 03:53 Read: times |
#89382 - Re: Writing 8 bits to LCD. Responding to: ???'s previous message |
Dear Kitti,
But if we've the HOURS, MINUTES, SECONDS variable which contains 8-bits binary value. Writing this exact 8 bits to LCD will show the number(decimal) on LCD or not? Will it automatically convert the 8bit binary to decimal? No, if you write the Hours, Minutes 8 bit values directly to your LCD it will not display what you want. [ I assume you use the hours, minutes etc. in binary format and not ascii ]. The LCD's always display ascii equivalent of the 8 bit stuff send to it. Thus inorder to display the required Hours, Minutes etc you need to convert your binary values to Two digit ascii and then send these two hour digits as two bytes to LCD and it will display those two digits. For converting your binary hours to two digit ascii hours you can do this. hours_first_digit = ( hours_binary / 10 ) + 0x30 ; hours_second_digit = hours_binary - ( hours_first_digit * 10 ) + 0x30 ; The two digits thus extracted can be sent to LCD to display two hour digits. Do the same for minutes and seconds as well. Keep in mind the binary equivalent of ascii '0'= 0x30 '1'= 0x31 ....... ....... '9'= 0x39 Thats why I add 0x30 to the binary digits. Regards, Prahlad Purohit |
Topic | Author | Date |
Writing 8bits binary number to LCD? | 01/01/70 00:00 | |
Re: Writing 8 bits to LCD. | 01/01/70 00:00 | |
Nope | 01/01/70 00:00 | |
0-9 = ok. 10+ = problem O_o | 01/01/70 00:00 | |
Not quite![]() | 01/01/70 00:00 | |
Re: | 01/01/70 00:00 | |
News to me ! | 01/01/70 00:00 | |
Re:News to me! | 01/01/70 00:00 | |
Pascal compilers. | 01/01/70 00:00 | |
Not Pinnacle | 01/01/70 00:00 | |
Unlikely | 01/01/70 00:00 | |
Y'think? | 01/01/70 00:00 | |
Sad, but true... :-( | 01/01/70 00:00 |