Make Own Character Using LCD I2C and ESP8266 - B24

Althaf Farras Ulayya Fauzi / 23106050090 Membuat karakter buatan sendiri seperti gambar hati, segitiga, atau orang bergerak.

BeginnerFull instructions provided30 minutes10
Make Own Character Using LCD I2C and ESP8266 - B24

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

SCL --> D1
SDA --> D2
VCC --> Vin 5V
GND --> GND

Perubahan Gambar Pola ke Biner

Perubahan Gambar Pola ke Biner, dimana Kotak putih diisi dengan gambar 0 dan Kotak Merah diisi dengan angka 1, sehingga anda dapat men sketsa gambar anda sendiri beserta kodenya

Code

Code Untuk Orang Berjalan

Python
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

LiquidCrystal_I2C lcd(0x27, 16, 2); // Mengatur alamat I2C dan ukuran LCD


byte customPersonWalk0[8] = {0b01110, 0b01110, 0b00100, 0b00111, 0b01100, 0b10110, 0b00101, 0b11001};
byte customPersonWalk1[8] = {0b01110, 0b01110, 0b00100, 0b10100, 0b01110, 0b00101, 0b01010, 0b10001};

//0b merupakan prefix standar yang digunakan untuk menampilkan pixel
//lima angka belakang merupakan perwakilan dari lima kolom data

void setup() {
  // put your setup code here, to run once:
  lcd.begin(); // Inisiasi LCD I2C
  lcd.backlight(); // Menyalakan backlight LCD
  lcd.createChar(0, customPersonWalk0); // Membuat karakter baru orang berlari
  lcd.createChar(1, customPersonWalk1); // Membuat karakter baru orang berlari
  Serial.begin(9600); // Program komunikasi atau setup untuk serial monitor dan kecepatan komunikasi
}

void loop() {
  for(int count = 0; count < 16; count++) { //Fungsi gambar mana yang akan ditampilkan
    lcd.clear();
    if((count % 2) == 0) {
      lcd.setCursor(count,0);
      lcd.write((byte)0);
    } else {
      lcd.setCursor(count,0);
      lcd.write((byte)1);
    }
    delay(250); //Waktu pergantian gambar
  }
}

Credits

Althaf Farras Ulayya Fauzi
1 project • 0 followers
Contact
dirakit community
23 projects • 109 followers
Indonesia IoT Community by Informatics UIN Sunan Kalijaga Yogyakarta
Contact

Comments

Please log in or sign up to comment.