??? 03/10/05 03:59 Read: times |
#89383 - Nope Responding to: ???'s previous message |
Kitti Wateesatogkit said:
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? Nope. If you have the number 57 (decimal) in your seconds counter and write that byte to the LCD, it will be displayed as '9' (the character represented by the ASCII value 57). To display the value on the LCD you must convert it to two ASCII bytes--35h and 37h in the "57" example. You can do this quickly by dividing the number by 10 (using DIV AB) and adding 30h to the result and sending that to the LCD as your first byte. Then take the remainder and add 30h to the result and send that to the LCD as your second byte. As long as the value you want to display is between 0 and 99, that approach should work. Or you might check the Code Library. I'm sure there's an applicable routine in there somewhere. Regards, Craig Steiner |
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 |