I2C.MASTER doesn't exist anymore
bertvandepoel opened this issue · 6 comments
When importing this library I keep running into the following error:
>>> import i2c_lcd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "i2c_lcd.py", line 10, in <module>
File "i2c_lcd.py", line 14, in Display
AttributeError: type object 'I2C' has no attribute 'MASTER'
From what I understand from https://forum.micropython.org/viewtopic.php?t=2710 it's been deprecated, but I must admit that this lowlevel stuff isn't really something I'm used to. Does any of this make sense and would there be an easy way for me to patch this. Your library sounds exactly like what I need, since I want to control a Grove 16x2 display using an rpi pico.
Hi @bertvandepoel , I'll admit I haven't revisited this library for a while! I can imagine it's definitely out of date with mainline micropython now as it was previously targeted towards pycom devices (a fork of micropython). I'd happily accept a pull request to make the fix to work with standard micropython, as I believe pycom is defunct now anyways.
If you're not sure about making a pull request, I can try to get around to updating the library but it may take me a while to find the time to do it. Let me know if you fancy the challenge.
From a quick glance, I'd assume you need to update the I2C library calls to mainline micropython. The underlying driver should still be functional for LCD screens.
Hey there! So the screen I am interfacing with is the non-RGB variant. You don't literally mention it, but it's almost identical based on the specs. The only thing is the backlight code is not very compatible as you can imagine. To get basic stuff working, I just patched out the MASTER stuff and it just works. No other changes required. I'm currently looking at enabling features of the non-RGB screen. I could easily contribute back my changes, but I'm not sure if you want to add support for more screens, and I wouldn't be able to test my code with a regular RGB one. How would you like to continue?
Can you share the model of LCD screen you are using? It'd be great to support both non-RGB and RGB; should be possible!
Oh, I missed your comment somehow, weird! I'm using this grove screen https://wiki.seeedstudio.com/Grove-16x2_LCD_Series/ which is just a 16x2 screen but with a solid colour backlight instead of an RGB one. In my case it's red but the specs are identical for the red, blue and yellow versions.