Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/14/07 19:14
Modified:
  05/14/07 19:17

Read: times


 
#139235 - A bit of help
Responding to: ???'s previous message
Hi Moh,

It may be a bit of help to you to note that before you can display a number on your LCD you must first convert it into ASCII text. For single digit numbers, 0 - 9, this conversion is dead easy. ASCII 0 is represented by 48d or 30x. ASCII 1 is represented by 49d or 31x, ASCII 2 is 50d or 32x, ..., to ASCII 9 being 57d or 39x. Thus, to convert a single digit number to ASCII text, simply add 48d or 30x to that number.

In the general case you will also have to deal with multiple digits, powers of ten or BCD or whatever, but I will leave that to you to work out. Once you know how to do single digits you should be able to easily understand the more complex algorithms of the general case, or very likely develop your own from scratch if you're so inclined.

List of 12 messages in thread
TopicAuthorDate
Display number on LCD 2x16            01/01/70 00:00      
   How far have you got?            01/01/70 00:00      
   perhaps reading the datasheet would help            01/01/70 00:00      
      Andy & Richard            01/01/70 00:00      
         Sorry!            01/01/70 00:00      
         Apologies where due, I guess I missed that.            01/01/70 00:00      
   A bit of help            01/01/70 00:00      
      See Code Library            01/01/70 00:00      
   convert to ASCII            01/01/70 00:00      
      Not BCD            01/01/70 00:00      
   Thanks            01/01/70 00:00      
      LCD asm printf function            01/01/70 00:00      

Back to Subject List