Replacing array member on the fly (big LCD characters idea)


+ Reply to Thread
Results 1 to 38 of 38

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    617

    Default Replacing array member on the fly (big LCD characters idea)

    Hello.
    I've created a large "font" from custom definable LCD characters, which look quite good. But to use with them with real software, I need a code which will translate some variable into these digit display. So to accomplish this, I've created two arrays, one for top row and one for bottom, which hold appropriate number of corresponding custom chars for the digit display. So to display the required char, I simply read values from arrays from index at that position and pass it to display. The code is as follows:

    Code:
    DTOP VAR BYTE[10] 'array for top line
    DBOT VAR BYTE[10] 'array for bottom line
    DTOP[0]=21 '0
    DBOT[0]=37
    DTOP[1]=96 '1 9 REPLACES 16
    DBOT[1]=96
    DTOP[2]=05 '2
    DBOT[2]=24
    DTOP[3]=05 '3
    DBOT[3]=47
    DTOP[4]=37 '4
    DBOT[4]=96
    DTOP[5]=20 '5
    DBOT[5]=45
    DTOP[6]=20 '6
    DBOT[6]=35
    DTOP[7]=81 '7
    DBOT[7]=96
    DTOP[8]=25 '8
    DBOT[8]=25
    DTOP[9]=25 '9
    DBOT[9]=96
    
    
    QROMA:
    FOR CNT=0 TO 9
    LCDOUT $FE,$01,DTOP[CNT] DIG 1, DTOP[CNT] DIG 0
    LCDOUT $FE,$C0,DBOT[CNT] DIG 1, DBOT[CNT] DIG 0
    PAUSE 1000
    NEXT
    GOTO QROMA
    But I run into problem, since I'm using "space" for some characters shape, namely 4, 7 and 9 and DEC code for space is 16, I can't put it into that arrays. In fact I can put it, but when I read array like I do in example code, with DIG statement, it will get ,messed, because say I need to display space at left and 6th custom char at right. If I put 166 into array (16 for space and 6 for that custom char), when I read it, the DIG 1 will return 6, not 16.

    So what can I do? One way I see is to use individual array elements, and omit usage of DIG, but this doubles array size.

    Any other ideas?
    Name:  CHARGEN.jpg
Views: 355
Size:  185.7 KB

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,025

    Default Re: Replacing array member on the fly (big LCD characters idea)


  3. #3
    Join Date
    Feb 2013
    Posts
    617

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Yes and I have done way better font for 2004 LCD, but here we're talking about 1602 parallel LCD, not serial, as in 1st link.

  4. #4
    Join Date
    Feb 2013
    Posts
    617

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Here is my font for 20x4 LCD displays. Far better than posted in the link above.
    Name:  charset.png
Views: 301
Size:  56.0 KB

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,025

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Really nice job on the big numbers.

    What is the difference between parallel - serial LCD? Other than electrical connections and some specific commands? Have not used serial so far but I guess behind the serial driver everything else is the same.

    Ioannis

  6. #6
    Join Date
    Feb 2013
    Posts
    617

    Default Re: Replacing array member on the fly (big LCD characters idea)

    Thanks. I have experience of making pseudographics (so called ASCII art) since early 80s. That set of characters also can be used to display most latin alphabet letters, except some. Regarding the LCD, I have no idea, but above example uses serial LCD and I don't see any PBP manual entries for serial LCD.

  7. #7
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    879

    Default Re: Replacing array member on the fly (big LCD characters idea)

    I counted 8 custom characters and a full block(possibly from the existing character set). Is that correct?

    Enumerating,

    Full rounded top left corner,
    Full rounded top right corner
    Full rounded bot left corner
    Full rounded bot right corner
    bottom line
    top line
    half rounded top left corner
    half rounded top right corner
    and
    the full block

Similar Threads

  1. String of characters(array) to decimal value
    By tacbanon in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 20th June 2012, 15:30
  2. write big text to lcd
    By isaac in forum General
    Replies: 3
    Last Post: - 8th October 2008, 02:45
  3. Big big big memory or tiny SDs!
    By Ron Marcus in forum Off Topic
    Replies: 9
    Last Post: - 25th May 2007, 19:02
  4. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21
  5. Replacing an ARRAY with EEPROM write to save space?
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th March 2005, 19:31

Posting Permissions

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