Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add I2C support #12

Closed
nils-van-zuijlen opened this issue Nov 13, 2019 · 9 comments
Closed

Add I2C support #12

nils-van-zuijlen opened this issue Nov 13, 2019 · 9 comments

Comments

@nils-van-zuijlen
Copy link
Contributor

I2C backpacks are available for HD44780 LCDs. They are mostly found in projects where the micro-controller does not have many pins or where an I2C bus is already in use.

A schematic for these backpacks can be found at https://www.electroschematics.com/arduino-i2c-lcd-backpack-introductory-tutorial/

It could be implemented by using a FourBitBus over I2C and by adding other controls for the RS, RW, E and BT (backlight) bits.

An Arduino library for driving LCD modules using these backpacks is available at https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library for reference

nils-van-zuijlen added a commit to nils-van-zuijlen/hd44780-driver that referenced this issue Nov 13, 2019
It handles I2C backpacks as described in JohnDoneth#12
JohnDoneth pushed a commit that referenced this issue Nov 17, 2019
* Add an I2CBus to the available buses

It handles I2C backpacks as described in #12

* Add example for I2CBus
@JohnDoneth
Copy link
Owner

Closed by #13

@mpbraendli
Copy link

Very happy to have discovered this! The fact that the i2c backpacks are supported is however not mentioned in the README, and it took me some searching to find out. Looking forward to trying out your library, many thanks!

@JohnDoneth
Copy link
Owner

@mpbraendli Thanks for the feedback! I'll put that in the README for future users.

@mpbraendli
Copy link

I found out that I had a different i2c backpack, with an MCP23008 expander (adafruit sells those).
I've added support here and I feel I'm close but not quite there yet:

mcp23008

This is supposed to show the customary "hello world"...

Would you perchance have an idea that could help me further? Did you ever see similar behaviour with your screens?

One thing I noticed:

In [1]: bin(ord('d'))                                                                                                                                                                                                                                                   
Out[1]: '0b1100100'

In [2]: bin(ord('l'))                                                                                                                                                                                                                                                   
Out[2]: '0b1101100'

@JohnDoneth
Copy link
Owner

@mpbraendli Interesting! I would try playing with the timing and seeing if that fixes it.

@mpbraendli
Copy link

There was an issue with my wiring that led to this half-working/half-broken state. It works fine now.

I've also improved documentation a bit, if you wish to take these modifications you can pull them from https://github.com/mpbraendli/hd44780-driver

Thanks again!

@piegamesde
Copy link

Please make a new release so that the i2c support actually shows up in the docs on crates.io

@JohnDoneth
Copy link
Owner

@piegamesde Thanks for the reminder, you can watch this issue #25 for the release.

@piegamesde
Copy link

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants