Display Format


Closed Thread
Results 1 to 2 of 2

Thread: Display Format

Hybrid View

  1. #1

    Default Display Format

    I am using the X-1 board with a 16F877A PIC. Learning the LCD and have a question formatting the display of a three digit versus four digit number.

    The first row of the LCD is just pretty much the header for the second row. The second row has numeric values. When the numeric values on the second line change from four to three digits, the rest of the second row shifts to the left one click. When this happens, the header row doesn't line up correctly with the second row. If there a way without using a bunch of 'IF' statements, I can format the second row to have each numeric value start in the same column? I wouldn't mind at all 900 looking like 0900. Here is the code I am using:

    Lcdout $fe, 1 ' Clear screen
    Lcdout "Stage Start End Prog"
    If StageState = 0 then
    Lcdout $fe, $c0,dec StageNum,"-S"," ",dec DisplaySTIme, " ",Dec DisplayETime
    else
    Lcdout $fe, $c0,dec StageNum,"-E"," ",dec DisplaySTIme, " ",Dec DisplayETime
    endif


    I tried using the following to display a leading 0 when a three digit number is used:

    Lcdout $fe, 1 ' Clear screen
    Lcdout "Stage Start End Prog"
    If StageState = 0 then
    Lcdout $fe, $c0,dec StageNum,"-S"," ",dec DisplaySTIme+0000, " ",Dec DisplayETime+0000
    else
    Lcdout $fe, $c0,dec StageNum,"-E"," ",dec DisplaySTIme+0000, " ",Dec DisplayETime+000
    endif

    That didn't work out. Any suggestions?

    Also, I would like to underline 'Start' or 'End' in the header column at times. What is the command for underline?

    Thanks
    Toby

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Tobias View Post
    Lcdout $fe, <font color=red>$c0</font color>,dec StageNum,"-S"," ",dec DisplaySTIme+0000, " ",Dec

    Thanks
    Toby
    Hello Tobias,
    The code in red is where you tell the LCD where to start, and can be decimal ($c0 = 192) or hex as you have it. You will find line 3 is a continuation of line 1 and line 4 is line 2 continued.
    Position 1 for each line is as follows: line 1 = 128, line 2 = 192, line 3 = 148 and line 4 = 212, so add 1 to each of the above to move them over 1 space, or add spaces to your string.
    HTH
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Hdsp 21xx display
    By Original in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th June 2012, 20:07
  2. Replies: 2
    Last Post: - 14th July 2008, 22:11
  3. DS1820 display with 7-seg 4 digits
    By chai98a in forum Code Examples
    Replies: 12
    Last Post: - 10th April 2008, 13:12
  4. need help on display problem
    By sixty9sandals in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 30th March 2007, 03:57
  5. graphics display
    By adlinsystems in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th June 2004, 12:53

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