Shop OBEX P1 Docs P2 Docs Learn Events
Serial LCD funky characters? — Parallax Forums

Serial LCD funky characters?

xanaduxanadu Posts: 3,347
edited 2012-04-08 08:58 in BASIC Stamp
Is there a way to show this character:

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-07 20:14
    Page 5 of the documentation for the display shows how to define custom characters and display them. The display controller can hold up to 8 custom 5 x 8 pixel character definitions.
  • xanaduxanadu Posts: 3,347
    edited 2012-04-07 21:27
    Thanks Mike.
    Mike Green wrote: »
    Page 5 of the documentation for the display shows how to define custom characters and display them. The display controller can hold up to 8 custom 5 x 8 pixel character definitions.

    I should have been posted my code.

    This works-
    SEROUT LTX, LcdBaud, [Lcdline2,"a"]  
    

    This doesn't-
    [code]
    SEROUT LTX, LcdBaud, [Lcdline2,"
  • xanaduxanadu Posts: 3,347
    edited 2012-04-08 00:43
    I found a work around. It's strange because coming from a web server's PHP script over the serial port I get ASCII translations like this:

    [code]
  • MikerocontrollerMikerocontroller Posts: 310
    edited 2012-04-08 01:39
    If your getting the top row as your output (asc II Extended set 128-255) but want to display the bottom characters (asc II 0-127) just subtract 128 from your asc number.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-08 06:47
    Look here for the ASCII and Extended ASCII character sets.

    ASCII is a character set that does not include the accented characters. Extended ASCII adds the accented characters, some graphics pieces, and other stuff. ASCII uses byte values 0-127 while Extended ASCII uses 0-255. All modern operating systems use Extended ASCII or further extended character sets for their display fonts to handle non-Roman alphabets better. The serial LCD uses ASCII. You have to use the custom characters for any accented characters.

    If you must display accented characters from the Extended ASCII character set, you have to go through the characters being sent to the display, test for any with values > 127, and translate them into a 10 character sequence that would first send the font for the character to the display as a custom character, followed by the custom character itself. There is no way to automatically translate the Extended ASCII characters to something displayable.
  • xanaduxanadu Posts: 3,347
    edited 2012-04-08 08:35
    Mike Green wrote: »
    Look here for the ASCII and Extended ASCII character sets.

    ASCII is a character set that does not include the accented characters. Extended ASCII adds the accented characters, some graphics pieces, and other stuff. ASCII uses byte values 0-127 while Extended ASCII uses 0-255. All modern operating systems use Extended ASCII or further extended character sets for their display fonts to handle non-Roman alphabets better. The serial LCD uses ASCII. You have to use the custom characters for any accented characters.

    If you must display accented characters from the Extended ASCII character set, you have to go through the characters being sent to the display, test for any with values > 127, and translate them into a 10 character sequence that would first send the font for the character to the display as a custom character, followed by the custom character itself. There is no way to automatically translate the Extended ASCII characters to something displayable.

    Thank you for the explanation. That makes perfect sense. I will test it in the code.
  • ercoerco Posts: 20,256
    edited 2012-04-08 08:58
    @jon: Speaking of funky characters, I've got a BS2 printing some custom characters on paper over in the robotics forum! :)

    http://forums.parallax.com/showthread.php?139146-Robot-Arm-Printer-Project&p=1088889&viewfull=1#post1088889
Sign In or Register to comment.