Last active
February 13, 2024 13:01
-
-
Save bavensky/8cc772149df9e349014b to your computer and use it in GitHub Desktop.
ESP8266 with 20x4 i2c LCD [Arduino IDE]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ESP8266 with 20x4 i2c LCD | |
// Compatible with the Arduino IDE 1.6.4 | |
// Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library | |
// Bavensky :3 | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x20,20,4); | |
uint8_t heart[8] = {0x0,0xa,0x1f,0x1f,0xe,0x4,0x0}; | |
void setup() { | |
#Wire.begin(0, 2); // For ESP-01 device cc.isidorogv | |
lcd.begin(); | |
lcd.backlight(); | |
lcd.createChar(1, heart); | |
} | |
void loop() { | |
lcd.home(); | |
lcd.print("Welcome to my world!"); | |
lcd.setCursor(2, 1); | |
lcd.write(byte(1)); | |
lcd.print(" ESP8266 with"); | |
lcd.setCursor(0, 2); | |
lcd.print(" LiquidCrystal I2C "); | |
lcd.setCursor(0, 3); | |
lcd.print("ChiangMai Maker Club"); | |
} |
how to connect. i use d1,d2 or d3 d4 in nodemcu board and it dont work
You have to connect pin GPIO4 for SDA and GPIO5 for SCL and Use "i2c_scanner" on Arduino IDE Example for check if the device it's connected.
would it be possible to have the SDA and SCLK lines connected to GPIO9 and GPIO10 on the NodeMCU ?
Problem is that I'm already using all the pins on the other side (excepted TX) and I just want to connect a 2004A LCD display for setup/debug of values read on the ADC. I'm multiplexing 4 inputs for the ADC but need to trim them with a multi-turn potmeter and it would be much easier with the LCD rather then the serial monitor.
Furthermore, #Wire.begin(...) gives "invalid preprocessing directive #Wire" error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's should be pin GPIO4 and GPIO5 on ESP8266