There is no USPS pickup on Monday Feb 15th, 2016 because of President's Day. USPS orders placed after 11am EST Fri February 12th will go out Tuesday February 16. UPS orders will ship as normal.

Pi Plate Backslash
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Pi Plate Backslash

by iscool007 on Wed Feb 27, 2013 1:18 pm

I have my plate working just fine, however when I try to display a Backslash "\", I get the Yen Character "¥". I've tried using hex "5C".decode("hex") in python with no avail.
Here's my code:

Code: Select all | TOGGLE FULL SIZE
#!/usr/bin/python

import sys
import os
import smbus

from CharLCDPlate import CharLCDPlate

lcd = CharLCDPlate(busnum = 1)


lcd.clear()
lcd.backlight(lcd.ON)
lcd.message("Hello...")

array = ('\\', '|','/','-')
#alternate array
#array = ("5C", "7C", "2F", "2D")

while 1:
   for a in array:
      lcd.setCursor(15,0)
      lcd.message(a)
      #lcd.message(a.decode("hex"))
      sleep(.5)
iscool007
 
Posts: 2
Joined: Wed Feb 27, 2013 1:04 pm

Re: Pi Plate Backslash

by tldr on Wed Feb 27, 2013 5:11 pm

looks like you've got a controller with the japanese character set. see the datasheet. you can put characters of your own invention in the first eight character positions.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: Pi Plate Backslash

by iscool007 on Wed Feb 27, 2013 9:57 pm

Thanks for the info. I looked at the datasheet: http://www.adafruit.com/datasheets/HD44780.pdf. According to page 17, character 0x5C is the Yen Character. I don't see a backslash anywhere for ROM Code: A00.
The LCD I recieved in the Adafruit LCD Pi Plate came with ROM Code A00. Seems as though backslash is not supported without creating a custom character.
iscool007
 
Posts: 2
Joined: Wed Feb 27, 2013 1:04 pm

Re: Pi Plate Backslash

by adafruit_support_rick on Thu Feb 28, 2013 6:59 am

See page 13 of the datasheet. The chip has character-generator RAM, which allows you to dynamically generate custom characters:
Character Generator RAM (CGRAM)
In the character generator RAM, the user can rewrite character patterns by program. For 5 ´ 8 dots, eight
character patterns can be written, and for 5 ´ 10 dots, four character patterns can be written.
Write into DDRAM the character codes at the addresses shown as the left column of Table 4 to show the
character patterns stored in CGRAM.
See Table 5 for the relationship between CGRAM addresses and data and display patterns.

adafruit_support_rick
 
Posts: 24905
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Pi Plate Backslash

by tldr on Thu Feb 28, 2013 7:11 pm

try
Code: Select all | TOGGLE FULL SIZE
    lcd.createChar (0, [0,0,32,16,8,4,2,0])


then instead of '\\' to print a backslash use '\x00'.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: Pi Plate Backslash

by pburgess on Thu Feb 28, 2013 10:53 pm

createChar() was added to the Pi code just last night, so you'll need to download the latest for this.

pburgess
 
Posts: 3367
Joined: Sun Oct 26, 2008 2:29 am

Please be positive and constructive with your questions and comments.