Using DisplayOTron to Display custom characters

Hi all,

Newbie here! I’m just playing about with my new DisplayOTron but having issues getting it to display custom characters.

I’ve read the documentation on the GitHub repository which addresses this issue (tried posting a link but its not letting me as I’m a new user) but still can’t get the custom character to display (standard ascii text is fine).

The code I’m trying to run is…

import dothat.lcd as lcd

char_map = [int(‘00011111’, 2),
int(‘00011111’, 2),
int(‘00011111’, 2),
int(‘00011111’, 2),
int(‘00011111’, 2),
int(‘00011111’, 2),
int(‘00011111’, 2),
int(‘00011111’, 2)]

lcd.create_char(0, char_map)
lcd.write(chr(0))

Where am I going wrong?!

Any and all help appreciated!

So you can get everything else working?

Hi,

Only playing with it for an hour or two last night but yeah. All the included examples which utilise custom characters also run!

I think you might have found a bug. Try:

import dothat.lcd as lcd

char_map = [int('00011111', 2),
int('00011111', 2),
int('00011111', 2),
int('00011111', 2),
int('00011111', 2),
int('00011111', 2),
int('00011111', 2),
int('00011111', 2)]

lcd.create_char(0, char_map)
lcd.set_cursor_position(0,0)
lcd.write(chr(0))

The library should call set_cursor_position itself after creating a char, since it’s (for some reason) stipulated as required. It looks like I did this for create_animation and update_animations but not for create_char.

Ohh, thanks for the response.

I’m at work now but I’ll try again tonight and update :)

Hi,

I’ve just added the set_cursor_position call to my code and everything now works fine :)

Is there an issue here which needs to be fixed in the library?

@gadgetoid pushed a fix upstream, to the parent st7036 library that is used to control the lcd.

Not sure when it will roll out to the normal channels (pypi, and more recently the deb package in the repo) though. So for now, that’s the best way to fix it.