Closed clach04 closed 2 years ago
Note due bug #36 CPython doesn't work out of the box with custom characters, e.g. the happy face sample in the readme fails.
Workaround:
# Monkey patch time
def sleep_us(usecs):
time.sleep(usecs / 1000000)
time.sleep_us = sleep_us # monkey patch
happy_face = bytearray([0x00,0x0A,0x00,0x04,0x00,0x11,0x0E,0x00])
happy_face = (
0b00001,
0b00010,
0b00010,
0b00110,
0b01000,
0b01000,
0b01000,
0b10000
)
lcd.custom_char(0, happy_face)
lcd.putchar(chr(0))
Link to online character editor