Create Custom Animation Art On 16×2 LCD Display

About this Project :

Create Custom Animations on 16×2 LCD DisplaysCreate Custom Animations on 16×2 LCD Displays GPL3+Easily display custom animated glyphs on 16×2 LCD using the createChar() function from the LiquidCrystal library.artgameslcd6,263 VIEWS17 COMMENTS45 RESPECTSCOMPONENTS AND SUPPLIESPh a000066 iso (1) ztbmubhmho Arduino UNOAny Arduino board.× 1 181 02 Adafruit Standard LCD – 16×2 White on BlueAny LCD display in size 16×2 that is compatible with the Hitachi HD44780 will work here.× 1 4415447 jg5sklyzsj Resistor 220 ohmAny resistor in the range 220 – 1k Ohm. A bigger value will dim the screen more.× 1 APPS AND ONLINE SERVICESIde web Arduino IDECustom Glyph GeneratorABOUT THIS PROJECTThe LiquidCrystal library makes it easy to use LCDs with Arduino. A particularly interesting function from that library is the createChar() function: you can create custom glyphs (characters), each described by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. Writing bytes by hand to create art is not exactly an artist’s ideal process, so I have made a web tool in which you can draw the glyphs, and the code is generated for you.In this article I will show how to create custom animations having only just an Arduino board and an LCD – which you can use to create a whole lot of projects: you can make a game, or a short story, or a music video, or decorate a status panel.

Components Required :

1 × Arduino Uno

1 × 16×2 LCD Display

1 × 220 ohm resistor

Creating Art :

Go to the tool at https://tusindfryd.github.io/screenduino/ and create your art. Up to 8 sections can be used at once, so if you cannot select a new square, make sure you’re not using 8 sections already.

Circuit diagram :

Code :

/*     butterfly metamorphosis animation        2021 ~ by tusindfryd    this code is in public domain*/#include <LiquidCrystal.h>LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // RS, E, D4, D5, D6, D7void setup(){    lcd.begin(16, 2);}void loop(){    image00();    delay(250);    image01();    delay(250);    image02();    delay(250);    image03();    delay(700);    image04();    delay(250);    image05();    delay(250);    image06();    delay(700);    image07();    delay(1250);}void image00(){    lcd.clear();    byte image22[8] = {B00110, B01101, B11011, B10011, B00111, B01111, B01111, B11111};    byte image23[8] = {B01111, B11110, B11100, B11000, B11000, B10000, B10000, B00000};    byte image07[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B00001, B00111};    byte image08[8] = {B00000, B01000, B10000, B10000, B10000, B11111, B11111, B11000};    byte image09[8] = {B00000, B00000, B00000, B00000, B00000, B11000, B11000, B00100};    lcd.createChar(0, image22);    lcd.createChar(1, image23);    lcd.createChar(2, image07);    lcd.createChar(3, image08);    lcd.createChar(4, image09);    lcd.setCursor(5, 1);    lcd.write(byte(0));    lcd.setCursor(6, 1);    lcd.write(byte(1));    lcd.setCursor(6, 0);    lcd.write(byte(2));    lcd.setCursor(7, 0);    lcd.write(byte(3));    lcd.setCursor(8, 0);    lcd.write(byte(4));}void image01(){    lcd.clear();    byte image22[8] = {B00110, B00101, B00011, B00011, B00111, B01111, B01111, B11111};    byte image23[8] = {B01111, B11110, B11100, B11000, B11000, B10000, B10000, B00000};    byte image07[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B11001, B10111};    byte image08[8] = {B00000, B01000, B10000, B10000, B10000, B11111, B11111, B11000};    byte image09[8] = {B00000, B00000, B00000, B00000, B00000, B11000, B11000, B00100};    byte image06[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B00000, B00011};    lcd.createChar(0, image22);    lcd.createChar(1, image23);    lcd.createChar(2, image07);    lcd.createChar(3, image08);    lcd.createChar(4, image09);    lcd.createChar(5, image06);    lcd.setCursor(5, 1);    lcd.write(byte(0));    lcd.setCursor(6, 1);    lcd.write(byte(1));    lcd.setCursor(6, 0);    lcd.write(byte(2));    lcd.setCursor(7, 0);    lcd.write(byte(3));    lcd.setCursor(8, 0);    lcd.write(byte(4));    lcd.setCursor(5, 0);    lcd.write(byte(5));}void image02(){    lcd.clear();    byte image22[8] = {B00000, B00001, B00011, B00011, B00111, B01111, B01111, B11111};    byte image23[8] = {B01111, B11110, B11100, B11000, B11000, B10000, B10000, B00000};    byte image07[8] = {B00000, B00000, B00000, B00001, B00111, B00100, B11001, B10111};    byte image08[8] = {B00000, B01000, B10000, B10000, B10000, B11111, B11111, B11000};    byte image09[8] = {B00000, B00000, B00000, B00000, B00000, B11000, B11000, B00100};    lcd.createChar(0, image22);    lcd.createChar(1, image23);    lcd.createChar(2, image07);    lcd.createChar(3, image08);    lcd.createChar(4, image09);    lcd.setCursor(5, 1);    lcd.write(byte(0));    lcd.setCursor(6, 1);    lcd.write(byte(1));    lcd.setCursor(6, 0);    lcd.write(byte(2));    lcd.setCursor(7, 0);    lcd.write(byte(3));    lcd.setCursor(8, 0);    lcd.write(byte(4));}void image03(){    lcd.clear();    byte image22[8] = {B00000, B00001, B00011, B00011, B00111, B01111, B01111, B11111};    byte image23[8] = {B01111, B11110, B11100, B11000, B11000, B10000, B10000, B00000};    byte image07[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B00001, B00111};    byte image08[8] = {B00000, B01000, B10000, B10000, B10000, B11111, B11111, B11010};    byte image09[8] = {B00000, B00000, B00000, B00000, B00000, B11000, B11000, B00100};    byte image24[8] = {B00010, B00111, B00111, B00111, B00111, B00111, B00010, B00000};    lcd.createChar(0, image22);    lcd.createChar(1, image23);    lcd.createChar(2, image07);    lcd.createChar(3, image08);    lcd.createChar(4, image09);    lcd.createChar(5, image24);    lcd.setCursor(5, 1);    lcd.write(byte(0));    lcd.setCursor(6, 1);    lcd.write(byte(1));    lcd.setCursor(6, 0);    lcd.write(byte(2));    lcd.setCursor(7, 0);    lcd.write(byte(3));    lcd.setCursor(8, 0);    lcd.write(byte(4));    lcd.setCursor(7, 1);    lcd.write(byte(5));}void image04(){    lcd.clear();    byte image22[8] = {B00000, B00001, B00011, B00011, B00111, B01111, B01111, B11111};    byte image23[8] = {B01111, B11110, B11100, B11000, B11000, B10001, B10000, B00000};    byte image07[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B00001, B00111};    byte image08[8] = {B00000, B01000, B10000, B10000, B10000, B11111, B11111, B11010};    byte image09[8] = {B00000, B00000, B00000, B00000, B00000, B11000, B11000, B00100};    byte image24[8] = {B00010, B00100, B01011, B10101, B11010, B10101, B11010, B01110};    byte image25[8] = {B00000, B00000, B00000, B10000, B10000, B00000, B00000, B00000};    lcd.createChar(0, image22);    lcd.createChar(1, image23);    lcd.createChar(2, image07);    lcd.createChar(3, image08);    lcd.createChar(4, image09);    lcd.createChar(5, image24);    lcd.createChar(6, image25);    lcd.setCursor(5, 1);    lcd.write(byte(0));    lcd.setCursor(6, 1);    lcd.write(byte(1));    lcd.setCursor(6, 0);    lcd.write(byte(2));    lcd.setCursor(7, 0);    lcd.write(byte(3));    lcd.setCursor(8, 0);    lcd.write(byte(4));    lcd.setCursor(7, 1);    lcd.write(byte(5));    lcd.setCursor(8, 1);    lcd.write(byte(6));}void image05(){    lcd.clear();    byte image24[8] = {B01010, B10100, B01011, B10101, B11010, B10101, B11010, B01110};    byte image25[8] = {B00000, B00000, B00000, B10000, B10000, B00000, B00000, B00000};    byte image23[8] = {B01101, B01010, B01101, B00111, B00000, B00000, B00000, B00000};    byte image07[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B00001, B00011};    byte image08[8] = {B00000, B00000, B00000, B00000, B00000, B00000, B00000, B10000};    lcd.createChar(0, image24);    lcd.createChar(1, image25);    lcd.createChar(2, image23);    lcd.createChar(3, image07);    lcd.createChar(4, image08);    lcd.setCursor(7, 1);    lcd.write(byte(0));    lcd.setCursor(8, 1);    lcd.write(byte(1));    lcd.setCursor(6, 1);    lcd.write(byte(2));    lcd.setCursor(6, 0);    lcd.write(byte(3));    lcd.setCursor(7, 0);    lcd.write(byte(4));}void image06(){    lcd.clear();    byte image08[8] = {B00000, B00100, B01010, B01010, B10001, B00011, B00110, B01100};    byte image07[8] = {B00000, B00000, B00000, B00000, B00001, B00010, B00010, B00001};    byte image09[8] = {B00000, B00000, B10000, B11000, B00000, B00000, B11000, B00100};    byte image24[8] = {B00100, B00100, B00011, B00000, B00000, B00000, B00000, B00000};    byte image25[8] = {B10000, B00000, B00000, B00000, B00000, B00000, B00000, B00000};    lcd.createChar(0, image08);    lcd.createChar(1, image07);    lcd.createChar(2, image09);    lcd.createChar(3, image24);    lcd.createChar(4, image25);    lcd.setCursor(7, 0);    lcd.write(byte(0));    lcd.setCursor(6, 0);    lcd.write(byte(1));    lcd.setCursor(8, 0);    lcd.write(byte(2));    lcd.setCursor(7, 1);    lcd.write(byte(3));    lcd.setCursor(8, 1);    lcd.write(byte(4));}void image07(){    lcd.clear();    byte image24[8] = {B10101, B01110, B01110, B00100, B10101, B01110, B00100, B11111};    byte image08[8] = {B00000, B00100, B01010, B01010, B10001, B00011, B00110, B01100};    byte image07[8] = {B00000, B00000, B00000, B00000, B00001, B00010, B00010, B00001};    byte image09[8] = {B00000, B00000, B10000, B11000, B00000, B00000, B00000, B00000};    lcd.createChar(0, image24);    lcd.createChar(1, image08);    lcd.createChar(2, image07);    lcd.createChar(3, image09);    lcd.setCursor(7, 1);    lcd.write(byte(0));    lcd.setCursor(7, 0);    lcd.write(byte(1));    lcd.setCursor(6, 0);    lcd.write(byte(2));    lcd.setCursor(8, 0);    lcd.write(byte(3));

Leave a Reply

Your email address will not be published. Required fields are marked *