Need help with LCD number display.


Results 1 to 9 of 9

Threaded View

  1. #4
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    My guess is that you are sending a simple byte out to the LCD, and it is then displaying the ASCII equivalent. For example, take the following:
    Code:
    Number1 VAR BYTE
    
    Number1 = 123
    When Number1 is sent directly to the LCD, it will cause the “{“ to display.

    What you will need to do is enumerate each decimal place of the number and send that to the LCD. For example:
    Code:
    Number1	VAR BYTE
    Temp 	VAR BYTE
    
    Number1 = 123
    
    ‘Get Value of digit in 100’s place
    Temp = Number1/100 ‘With Number1 = 123 then Temp = 1
    Temp = Temp + 48 ‘Convert value to ASCII equivalent
    ‘Send temp to LCD
    
    ‘Get Value of digit in 10’s place
    Temp = Number/10 ‘With Number1 = 123 then Temp = 12
    Temp = Temp//10 ‘Get Remainder so with Number1 = 123 then Temp = 2
    Temp = Temp + 48 ‘Convert value to ASCII equivalent
     ‘Send temp to LCD
    
    ‘Get Value of digit in 1’s place
    Temp = Number1//10 ‘Get Remainder so…with Number1 = 123 then Temp = 3
    Temp = Temp + 48 ‘Convert value to ASCII equivalent
     ‘Send temp to LCD
    This will print out the leading "0"s, and will only enumerate a BYTE. It's just a simple code example, but it should help explain the concept and get you started on a more specific solution to met you needs.

    Hope this helps, good luck.

    SteveB
    Last edited by SteveB; - 29th May 2007 at 17:43.

Similar Threads

  1. LCD Display
    By lambert in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th January 2010, 22:18
  2. LCD display not working properly
    By dilpkan in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 2nd February 2008, 07:43
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. LCD Display not working - PIC heating...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 24th September 2006, 07:35
  5. A/D display result on LCD
    By winsthon in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th January 2004, 10:09

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts