Project 5: ESP32 Output Display

  1. ESP32 Devkit V1
  2. Female-to-female jumper wires
  3. 16×2 I2C LCD
source: https://randomnerdtutorials.com/esp32-esp8266-i2c-lcd-arduino-ide/
  1. Click this link https://github.com/marcoschwartz/LiquidCrystal_I2C/archive/master.zip and you will have a zip folder in your computer.
  2. Unzip the folder and you should see the LiquidCrystal_I2C-master folder. Rename that to LiquidCrystal_I2C.
  3. Move LiquidCrystal_I2C folder to your Arduino libraries folder.
  4. Then, open your Arduino.
#include <Wire.h>

void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("\nI2C Scanner");
}

void loop() {
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ ) {
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0) {
Serial.print("I2C device found at address 0x");
if (address<16) {
Serial.print("0");
}
Serial.println(address,HEX);
nDevices++;
}
else if (error==4) {
Serial.print("Unknow error at address 0x");
if (address<16) {
Serial.print("0");
}
Serial.println(address,HEX);
}
}
if (nDevices == 0) {
Serial.println("No I2C devices found\n");
}
else {
Serial.println("done\n");
}
delay(5000);
}
#include <LiquidCrystal_I2C.h>

// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;

// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);

void setup(){
// initialize LCD
lcd.init();
// turn on LCD backlight
lcd.backlight();
}

void loop(){
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print("Hello, World!");
delay(1000);
// clears the display to print new message
lcd.clear();
// set cursor to first column, second row
lcd.setCursor(0,1);
lcd.print("Hello, World!");
delay(1000);
lcd.clear();
}

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Implement rich message buttons in Dialogflow with suggestion chips

How I convinced an employer to take a chance on me and pay me to learn to code.

VMC on AWS

Conversation is just a game.

A monorepo, GitHub Flow and automation FTW

Integration of GitHub,Jenkins and Docker (Web Page Deployment)

Automatically launch docker-compose from Gradle for dev and integration tests

THE MOST COMMON IT ROLES

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alvito Rizqi

Alvito Rizqi

More from Medium

Database introduction

Press Releases Communication System

Design Hero: Milton Glaser — Poster

The Importance of RESTful Routing, UI