Skip to content

Instantly share code, notes, and snippets.

@benevpi
Created February 28, 2020 14:26
Show Gist options
  • Save benevpi/f1a1407aebc6dd9eca9b3905e0262078 to your computer and use it in GitHub Desktop.
Save benevpi/f1a1407aebc6dd9eca9b3905e0262078 to your computer and use it in GitHub Desktop.
#include <LiquidCrystal.h>
LiquidCrystal lcd(21, 19, 17, 16, 15, 14);
byte star_1[8] = {
B00000,
B00000,
B00000,
B00100,
B00000,
B00000,
B00000,
};
byte star_2[8] = {
B00000,
B00000,
B01010,
B00100,
B01010,
B00000,
B00000,
};
byte star_3[8] = {
B00000,
B10001,
B01010,
B00100,
B01010,
B10001,
B00000,
};
byte star_4[8] = {
B10101,
B10001,
B01010,
B10101,
B01010,
B10001,
B10101,
};
void setup() {
lcd.begin(16, 2);
lcd.createChar(0, star_1);
lcd.createChar(1, star_2);
lcd.createChar(2, star_3);
lcd.createChar(3, star_4);
}
void loop() {
lcd.setCursor(0,0);
lcd.write(byte(0));
delay(500);
lcd.setCursor(0,0);
lcd.write(byte(1));
delay(500);
lcd.setCursor(0,0);
lcd.write(byte(2));
delay(500);
lcd.setCursor(0,0);
lcd.write(byte(3));
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment