I2C LCD Library for the ATSAMD21G18 processor ( Solved #4)

The standard LCD library ( I2C ) that works with the Uno does not work with M0 processor. ( HD44780 LCD driver )

I have been reading this forum on this topic and looks like I have lots of company ( if that's any comfort !)

Question is :

Can the standard I2C LCD library that works for the AVR chips be tweaked to work with the M0 ?

Is there any specific library targeting this requirement ?

Thanks

Not sure what library you mean by "The standard LCD library ( I2C ) that works with the Uno" as the Arduino IDE does not bundle an i2c library that talks to a hd44780 lcd. The IDE only includes the LiquidCrystal library which does not use I2C.

I would recommend that you use my hd44780 library. It should work on any *duino board, including the MO board as the library uses only standard Arduino core library calls. If you have a LCD with a i2c backpack, it does depend on the core providing a Wire library but the MO board appears to be supported by the Arduino.cc supplied Arduino IDE SAMD core.

I don't have an MO board to test it, so I can't verify that it works.

If there are any issues, I would like to know about it to fix it.

The library is available in the IDE library manager and should be installed using the IDE library manager cloud installation.
(i.e. don't install it by downloading a zip file from the github site)
See the github page: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
and included Documentation "sketch" for more details and documentation including how to install the library, the i/o classes available, and how to locate and use the appropriate examples.

--- bill

Thanks Bill.

Will sure try out the link you gave and revert back.

The one that causes me issues with the M0 is attached herewith as a ZIP file. Sorry I should have mentioned which in my first post.

LiquidCrystal.zip (458 KB)

The library is available in the IDE library manager and should be installed using the IDE library manager cloud installation.

Sorry but what exactly is this cloud installation ? I just read the instructions on the GitHub page and for versions of Arduino beyond 1.6 it talks of the regular installation and to rename the folder to hd44780. This I have did.

Let me compile and check ….

Ardubit:
The one that causes me issues with the M0 is attached herewith as a ZIP file. Sorry I should have mentioned which in my first post.

That is the NewLiquidCrystal by fm.
It does have some architecture specific code that can get tripped up and not work with certain cores or certain versions of the IDE.
It also requires removing and replacing the original IDE bundled LiquidCrystal library.
hd44780 doesn't have those issues.

Ardubit:

The library is available in the IDE library manager and should be installed using the IDE library manager cloud installation.

Sorry but what exactly is this cloud installation ?

Perhaps "cloud installation" is not a good term. Not sure what to really call it.
The IDE library manager has several ways to install libraries.
You can install from a .zip file or you can let the library manager pull the library from the network (its cloud storage).
The latter works with IDE versions after version 1.6.2

I just read the instructions on the GitHub page and for versions of Arduino beyond 1.6 it talks of the regular installation and to rename the folder to hd44780. This I have did.

Actually that isn't what the instructions said. It said not to use the zip install with newer IDE versions as the library manager does everything for you by downloading the library from the network so there is no need to mess with downloading zip files or renaming of directories.
Not only is using the network/cloud install easier than messing with zip images but it also ensures that you get a released version of the library and that it is properly installed.

You should be using an IDE newer than 1.6.2 as there have been many updates, feature additions, and bug fixes since then.
I'd recommend using a very recent version like 1.8.7 or the latest at 1.8.8

--- bill

Kudos Bill !!

The HD44780 library worked like magic the first shot. I loved your detailed explanantions to use the library and the fact that the library searches for the connected LCD backpack and links to it vis I2C. Great !!

My project with the M0 processor and BLE comm has become a reality thanks to the library.

Thanks.