Using Nokia LCD


Closed Thread
Results 1 to 40 of 301

Thread: Using Nokia LCD

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Easy to print variables (and long strings)

    Ok, the printing a variable solution:
    Code:
    PosX = 0                          'position 0 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 3) + 48
    gosub Lcd_SendChar
    
    PosX = 6                          'position 6 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 2)+ 48
    gosub Lcd_SendChar
    
    PosX = 12                          'position 12 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 1) + 48
    gosub Lcd_SendChar
    
    PosX = 18                          'position 18 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 0) + 48
    gosub Lcd_SendChar
    got a little old. So I managed to write my first macro. It lets you do the above with a two liner:

    Code:
        
    VarData = 12345   'load the variable with desired number
    @ PrintVar 0,0      'print the variable VarData, starting at the desired location 0,0
    The code does the rest, and moves to the next position to print the next digit, until done.
    I also edited the PrintStr function to scroll to the next line when it runs past the end of the current line.

    Code:
    @ PrintStr 0,0, "If I write more than one line, it will scroll to the next one, and next."
    It runs on an 18f67j50. Not sure if it would run on a 16f or not.
    Attached Files Attached Files

Similar Threads

  1. Nokia COLOR LCD PicBasicPro 2.50a example code
    By skimask in forum Code Examples
    Replies: 49
    Last Post: - 28th September 2011, 01:43
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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