No matter what code I use for the ESP32 and IC2 I get the error: Compilation error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive].
I have the correct address that I found with the scanner.
Even Verify gives the error.
Why is the code not working. I use the latest Arduino.
With a code for ESp8266 all is perfect working .
You started a topic in the Uncategorised category of the forum whose description is
DO NOT CREATE TOPICS IN THIS CATEGORY ![]()
Your topic has been moved to the Programming category
What code would that be ? Please post it, using code tags when you do
i use.
i use.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2); // LCD address is 0x3F, 16 is chars, 2 is 2 line display
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Hello world");
lcd.setCursor(1,0);
lcd.print("It Works!");
}
void loop()
{
}
Please post the full error message copied from the IDE using the Copy error message button
using Tools>Board ESP32 Dev Module the code of post 3 compiles OK
library used

C:\Users\digiton\AppData\Local\Temp\.arduinoIDE-unsaved20231012-25456-6x15gn.yltk9\sketch_nov12a\sketch_nov12a.ino:4:32: error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
LiquidCrystal_I2C lcd(0x3F,16,2); // LCD address is 0x3F, 16 is chars, 2 is 2 line display
^
In file included from C:\Users\digiton\AppData\Local\Temp\.arduinoIDE-unsaved20231012-25456-6x15gn.yltk9\sketch_nov12a\sketch_nov12a.ino:2:
e:\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:53:76: note: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)'
LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);
~~~~~~~~~~~~~~^~~
C:\Users\digiton\AppData\Local\Temp\.arduinoIDE-unsaved20231012-25456-6x15gn.yltk9\sketch_nov12a\sketch_nov12a.ino: In function 'void setup()':
C:\Users\digiton\AppData\Local\Temp\.arduinoIDE-unsaved20231012-25456-6x15gn.yltk9\sketch_nov12a\sketch_nov12a.ino:8:10: error: 'int LiquidCrystal_I2C::init()' is private within this context
lcd.init();
^
In file included from C:\Users\digiton\AppData\Local\Temp\.arduinoIDE-unsaved20231012-25456-6x15gn.yltk9\sketch_nov12a\sketch_nov12a.ino:2:
e:\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:154:9: note: declared private here
int init();
^~~~
Multiple libraries were found for "Wire.h"
Used: C:\Users\digiton\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire
Not used: E:\Arduino\libraries\Wire
exit status 1
Compilation error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
There are numerous libraries with the name LiquidCrystal_I2C
I suspect that the code that you are using is not compatible with the library that you are using as the functions are different. Look at the examples that came with the library that you have to see how to use it. There is almost certainly a simple "Hello World" example
Many thanks again. With your indicated library the IC2 everything works, but when I go to my ESP8266 project that used to work perfectly I get the error Compilation error: 'POSITIVE' was not declared in this scope. How do I manage to use both modules?
My advice would be to decide which library that you are going to use and change the code to suit it
Looks like this is the possibility. Have now made 2 separate libraries and use the ones I need. Thanks again many times for your solution.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
