I tried to connect an LCD display to the I2C of the machine control port. I was able to connect it successfully and display some values using the Arduino Mega with the following libraries: #include <LCD.h> and #include <LiquidCrystal_I2C.h>. However, when I tested the same code on the Arduino Machine Control, it did not work.
Has anyone successfully used this library with the Portenta Machine Control? Alternatively, can someone suggest a library that can be used with the onboard I2C for an LCD or OLED display? I am using the LCD2004 with an I2C converter and the OLED display AL4002A.
Update:
I use the library hd44780--> io class --> i2cExp --> Hello Word.
it work fine
#include <Wire.h>
#include <hd44780.h> // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip
// hd44780_I2Cexp lcd1(0x20);
hd44780_I2Cexp lcd2(0x27);
// LCD geometry
const int LCD_COLS = 40;
const int LCD_ROWS = 2;
void setup() {
int status;
status = lcd2.begin(LCD_COLS, LCD_ROWS);
if (status) // non zero status means it was unsuccesful
{
hd44780::fatalError(status); // does not return
}
lcd2.print("Hello Word");
}
void loop() {}