Skip to content

Instantly share code, notes, and snippets.

@cbscribe
Last active December 2, 2020 23:03
Show Gist options
  • Save cbscribe/8279ba28d61b12b43b337f06d205b6fa to your computer and use it in GitHub Desktop.
Save cbscribe/8279ba28d61b12b43b337f06d205b6fa to your computer and use it in GitHub Desktop.
LCD animated character example
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
byte Alien[] = {
B11111,
B10101,
B11111,
B11111,
B01110,
B01010,
B11011,
B00000
};
void setup() {
lcd.begin(16, 2);
lcd.createChar(1, Alien);
}
int row = 0;
int col = 0;
void loop()
{
lcd.clear();
lcd.setCursor(col, row);
lcd.write(1);
col++;
if (col > 15)
{
col = 0;
row++;
}
if (row > 1)
{
row = 0;
}
delay(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment