Arduino + ESP-01 1602 LED
Arduino + ESP-01 1602 LED
This page is to Setup and Config ESP-01 + 1602 LED
Hardware and Software
Hardware
Arduino + ESP 01
Software
Arduino IDE
// ESP8266 with 16x2 i2c LCD
// Compatible with the Arduino IDE 1.6.6
// Library https://github.com/agnunez/ESP8266-I2C-LCD1602
// Original Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
// Modified for ESP8266 with GPIO0-SDA GPIO2-SCL and LCD1206 display
// edit library and change Wire.begin() by Wire.begin(sda,scl) or other GPIO's used for I2C
// and access from lcd.begin(sda,scl)
Example : http://ruten-proteus.blogspot.hk/2015/05/esp8266-esp-01-at023-sdk101.html
Sanki Notes
Examples
This example is Display on 1602 LED by ESP-01
Examples
Character Example -- Very Good
Examples - Position
Character Example -- Very Good
// ESP8266 with 16x2 i2c LCD
// Compatible with the Arduino IDE 1.6.6
// Library https://github.com/agnunez/ESP8266-I2C-LCD1602
// Original Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
// Modified for ESP8266 with GPIO0-SDA GPIO2-SCL and LCD1206 display
// edit library and change Wire.begin() by Wire.begin(sda,scl) or other GPIO's used for I2C
// and access from lcd.begin(sda,scl)
/**
* Displays text sent over the serial port (e.g. from the Serial Monitor) on
* an attached LCD.
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
lcd.begin(0,2);
lcd.backlight();
// Initialize the serial port at a speed of 9600 baud
Serial.begin(9600);
}
void loop()
// ESP8266 with 16x2 i2c LCD
{
// Compatible with the Arduino IDE 1.6.6
// If characters arrived over the serial port...
// Library https://github.com/agnunez/ESP8266-I2C-LCD1602
if (Serial.available()) {
// Original Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
// Wait a bit for the entire message to arrive
// Modified for ESP8266 with GPIO0-SDA GPIO2-SCL and LCD1206 display
delay(100);
// edit library and change Wire.begin() by Wire.begin(sda,scl) or other GPIO's used for I2C
// Clear the screen
// and access from lcd.begin(sda,scl)
lcd.clear();
#include <Wire.h>
// Write all characters received with the serial port to the LCD.
#include <LiquidCrystal_I2C.h>
while (Serial.available() > 0) {
lcd.write(Serial.read());
uint8_t bell[8] = {0x4, 0xe, 0xe, 0xe, 0x1f, 0x0, 0x4};
}
uint8_t note[8] = {0x2, 0x3, 0x2, 0xe, 0x1e, 0xc, 0x0};
}
uint8_t clock[8] = {0x0, 0xe, 0x15, 0x17, 0x11, 0xe, 0x0};
}
uint8_t heart[8] = {0x0, 0xa, 0x1f, 0x1f, 0xe, 0x4, 0x0};
uint8_t duck[8] = {0x0, 0xc, 0x1d, 0xf, 0xf, 0x6, 0x0};
uint8_t check[8] = {0x0, 0x1 ,0x3, 0x16, 0x1c, 0x8, 0x0};
uint8_t cross[8] = {0x0, 0x1b, 0xe, 0x4, 0xe, 0x1b, 0x0};
uint8_t retarrow[8] = { 0x1, 0x1, 0x5, 0x9, 0x1f, 0x8, 0x4};
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
lcd.begin(0,2);
lcd.backlight();
lcd.createChar(0, bell);
// ESP8266 with 16x2 i2c LCD
lcd.createChar(1, note);
// Compatible with the Arduino IDE 1.6.6
lcd.createChar(2, clock);
// Library https://github.com/agnunez/ESP8266-I2C-LCD1602
lcd.createChar(3, heart);
// Original Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
lcd.createChar(4, duck);
// Modified for ESP8266 with GPIO0-SDA GPIO2-SCL and LCD1206 display
lcd.createChar(5, check);
// edit library and change Wire.begin() by Wire.begin(sda,scl) or other GPIO's used for I2C
lcd.createChar(6, cross);
// and access from lcd.begin(sda,scl)
lcd.createChar(7, retarrow);
lcd.home();
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
lcd.print("Hello world...");
lcd.setCursor(0, 1);
LiquidCrystal_I2C lcd(0x27,16,2); // Check I2C address of LCD, normally 0x27 or 0x3F
lcd.print(" i ");
lcd.write(3);
uint8_t heart[8] = {0x0,0xa,0x1f,0x1f,0xe,0x4,0x0}; // example sprite bitmap
lcd.print(" arduinos!");
delay(5000);
void setup() {
displayKeyCodes();
lcd.begin(0,2); // In ESP8266-01, SDA=0, SCL=2
}
lcd.backlight();
lcd.createChar(1, heart);
// display all keycodes
}
void displayKeyCodes(void) {
uint8_t i = 0;
void loop() {
lcd.home(); // At column=0, row=0
while (1) {
lcd.print("ESP8266");
lcd.clear();
lcd.setCursor(0, 1);
lcd.print("Codes 0x");
lcd.print("LiquidCrystalI2C");
lcd.print(i, HEX);
delay(500);
lcd.print("-0x");
lcd.setCursor(10, 0); // At column=10, row=0
lcd.print(i + 16, HEX);
lcd.write(byte(1));
lcd.setCursor(0, 1);
delay(500);
lcd.setCursor(10, 0); // At column=10, row=0
for (int j = 0; j < 16; j++) {
lcd.print(" "); // Wipe sprite
lcd.write(i + j);
}
}
i += 16;
delay(4000);
}
}
void loop()
{
// Do nothing here...
}