makecode-extensions / i2cLCD1602

makecode I2C LCD1602 package for microbit
MIT License
13 stars 21 forks source link

20 x 4 display #1

Open SteveJSmythe opened 5 years ago

SteveJSmythe commented 5 years ago

Hello Is it possible to modify this extension to support 20 x 4 displays? Thanks Steve

shaoziyang commented 5 years ago

Yes, I think it easy to support 20 x 4 LED display, but I have no one to test.

SteveJSmythe commented 5 years ago

That's good. I was looking at your typescript code and thought it could easily be changed to support 20x4 mode. I'd be very happy to test it for you.

shaoziyang commented 5 years ago

LCD 2004 is most same as LCD 1602, but DDRAM is different.

Please refer to the datasheet of LCD2004.

https://www.sparkfun.com/datasheets/LCD/GDM2004D.pdf

SteveJSmythe commented 5 years ago

OK. I got it working with 20x4 display. I changed lines 106, 107, 117, 118, 122, 123 to show the min/max row/col and then I added else ifs after line 128 with "a=0x94" for line 3 and "a=0xD4" for line 4. I haven't changed the image file LCD1602_I2C.svg yet, but everything else seems to work fine on the two 20x4 displays I tried.

Thanks

shaoziyang commented 5 years ago

That is great.