Skip to content

putchar() can’t display custom chars #43

Description

@CptDangerous

I have an application which drives a 20x4 LCD display on a RPi Pico. I have 6 custom characters which I need to display occasionally. However, when I try to send a number between 0 & 5 via putchar() I get an error at line 147 in lcd_api.py

On investigation I had to modify the code at line 147 as follows:

original code:

self.hal_write_data(ord(char))

which I moded to:

if type(char) is int:
    self.hal_write_data(char)
else:
    self.hal_write_data(ord(char))

This successfully allowed the api to display my custom chars but I have no idea if it would break other applications.

I guess it would be possible to move the test for int to the calling code and call hal_write_data() if test returns True. That somehow offends my OCD and wouldn’t advance the LCD cursor. 😀

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions