Created
February 8, 2021 05:13
This file contains hidden or 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
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27, 16, 2); | |
byte customPersonWalk0[8] = { | |
0b01110, | |
0b01110, | |
0b00100, | |
0b00111, | |
0b01100, | |
0b10110, | |
0b00101, | |
0b11001 | |
}; | |
byte customPersonWalk1[8] = { | |
0b01110, | |
0b01110, | |
0b00100, | |
0b10100, | |
0b01110, | |
0b00101, | |
0b01010, | |
0b10001 | |
}; | |
void setup() { | |
// put your setup code here, to run once: | |
lcd.begin(); // Inisiasi LCD I2C | |
lcd.backlight(); // Menyalakan backlight LCD | |
lcd.createChar(0, customPersonWalk0); | |
lcd.createChar(1, customPersonWalk1); | |
Serial.begin(9600); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
for(int count = 0; count < 16; count++) { | |
lcd.clear(); | |
if((count % 2) == 0) { | |
lcd.setCursor(count,0); | |
lcd.write((byte)0); | |
} else { | |
lcd.setCursor(count,0); | |
lcd.write((byte)1); | |
} | |
delay(1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment