LiquidCrystal I2C library that works with MKR

Hello,

I'm trying to run a sparkfun LCD through the I2C port on my MKR board. The example I'm trying to follow tells me to use the LiquidCrystal I2C library. When I go to compile, it tells me that the library is not compatible with the MKR family. I'm new to Arduino and I'm learning from the Arduino Workshop book. There is a project I'm working on that needed a faster clock speed than the UNO so I got the MRK. Can you please help me get this part of my project working.

Thank You

//include liquidCrystal_I2C.h 
//Tools -> Manage Libraries and type liquidCrystal_I2C

#include <LiquidCrystal_I2C.h>

//define I2C address......
LiquidCrystal_I2C lcd(0x27,16,2);


void setup() {
  lcd.init();
  lcd.clear();
  lcd.backlight();

  lcd.setCursor(2,0);
  lcd.print("Hello World");

  lcd.setCursor(2,1);
  lcd.print("JehanKandy");

}

void loop() {

Can you post a copy of the error message?


You might want to try my I2C_LCD library

Only a small change in code, and it does compile (not tested with hardware)

//include liquidCrystal_I2C.h 
//Tools -> Manage Libraries and type I2C_LCD

#include <I2C_LCD.h>

//define I2C address......
I2C_LCD lcd(0x27);

void setup() {
  lcd.begin(16,2);
  lcd.clear();
  lcd.backlight();

  lcd.setCursor(2,0);
  lcd.print("Hello World");

  lcd.setCursor(2,1);
  lcd.print("JehanKandy");
}

void loop() {}

The program compiles not but it did not display text on the LCD Screen. Thank you for getting me a step closer! I found an I2C scanner and it did pick up the LCD display. Do you have any recommendations on the next thing I should do to troubleshoot?

add Wire.begin() as first line in setup()

I went to the spark fun website and saw that they have their own mega library. It can be found here. I downloaded it and it worked. Thank you so much for helping me. It's good that this exists because there are a lot of forum questions about the same topics that don't have answers. Thanks again!!!