Has anyone used https://github.com/johnrickman/LiquidCrystal_I2C this LCD library with vscode and platformio and does it work, I get init() is private method? I use it with the Arduino IDE and all is well is just with platform io and vscode, I am pretty sure I have my paths set up correctly. vscode is complaining about the private init() method.
How did you install the library?
Can you tell me the library ID or library name to include in the platfomIO.ini file, so that I can experiment?
Hi Sara, I found the answer I just moved the init() method to the puplic section in the LiquidCrystal_I2C.h file. Here is the lcd library details:
// Created by Francisco Malpartida on 20/08/11.
// Copyright (C) – 2018
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License v3.0
// along with this program.
// If not, see <https://www.gnu.org/licenses/gpl-3.0.en.html>.
I have the impression that you are confusing 2 distinct libraries. In your first post you refer to John Rickman’s one which was hosted on GitHub:
And which is now hosted on GitLab under another name:
While in your 2nd post, it seems that you are actually using the New LiquidCrystal library, from Francesco Malpartida, which was hosted on Bitbucket:
But that is no longer the case since Bitbucket discontinued hosting Mercurial repositories.
An old version still seems to exist on GitHub, but it is no longer up to date since the latest available version displayed in PlatformIO is version 1.5, released a year ago.
In order for us to know exactly which library you are referring to, you would have to tell us exactly the name and identifier of the library in PlatformIO, as Sara asked you to do.
That of Francesco Malpartida bears the name LiquidCrystal and the identifier 136. Here is the PlatformIO reference:
Is this the one you are using?
If this is the one, I think you are not proceeding in the right way to initialize your instance. If its author has encapsulated the
init() method of the
LiquidCrystal_I2C class, he has a good reason to do so. You cannot use this interface to initialize your instance. Instead, take a look at the HelloWorld_i2C example provided by the library, which initializes the instance directly using the constructor of the class:
LiquidCrystal_I2C lcd(0x38); // Set the LCD I2C address
Then using the
lcd.begin(16,2); // initialize the lcd