I2C LCD screen with Raspberry Pi Pico

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
emartti
Posts: 2
Joined: Fri Feb 12, 2021 8:52 pm

Re: I2C LCD screen with Raspberry Pi Pico

Post by emartti » Fri Feb 12, 2021 10:05 pm

Hello, could I get some help please?

I'm trying to get a crowtail ic2 lcd to work on the pico, it has the MCP23008 module, so pyb_i2c_adafruit_lcd.py and pyb_i2c_adafruit_lcd_test.py should work for me right?

I tried to convert it to pico friendly from pyb, and I get no errors on running it, but the lcd doesn't seem to recieve any commands, it's not backlit but the top row is full. I tested the esp8266 files just in case, but didn't seem to work either. I've used the lcd on arduino before, so there shouldn't be any hardware issues.

I'm not sure if I have the i2c commands correct, I tried to copy from them from the esp8266 files. I would appreciate pointing out the errors.

Here's a link my code: https://github.com/EMartti/crowtail-i2c ... /tree/main

Thank you

User avatar
dhylands
Posts: 3601
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: I2C LCD screen with Raspberry Pi Pico

Post by dhylands » Fri Feb 12, 2021 11:10 pm

Is it the adafruit backback? https://www.adafruit.com/product/292 Or just a backpack that uses the 23008?

The 23008 is just an I2C GPIO expander, so the code would only work as-is if your 23008 is wired up to the LCD in exactly the same manner as the adafruit one.

emartti
Posts: 2
Joined: Fri Feb 12, 2021 8:52 pm

Re: I2C LCD screen with Raspberry Pi Pico

Post by emartti » Sun Feb 21, 2021 6:37 pm

I got it to work in the end, seemed that I was sending bytes in the wrong format, for example if I wanted to send byte I had to write it as bytearray([byte]).

The code is here if someone is interested: https://github.com/EMartti/rasperry_pi_ ... n/1602_LCD

Thanks for the original files I would have been lost without them :D

User avatar
dhylands
Posts: 3601
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: I2C LCD screen with Raspberry Pi Pico

Post by dhylands » Tue Feb 23, 2021 9:15 pm

I created the following 2 files:
https://github.com/dhylands/python_lcd/ ... i2c_lcd.py
https://github.com/dhylands/python_lcd/ ... cd_test.py

which I tested on my RPi Pico using a SparkFun voltage converter: https://www.sparkfun.com/products/12009
Attachments
IMG_3313.JPG
IMG_3313.JPG (180.81 KiB) Viewed 100 times

Post Reply