top of page

7- Happy Eid by engineers


DISCOVER: LCD displays, LiquidCrystal library, create custom char.

with the LCD display and a few of resistors, I made my own way to say "Happy Eid" to my family and friends. LET'S be different and creative to congratulate who really means to us by making something special so they will not forget it.

and yeah Think Outside the Box

LCD (Liquid Crystal displays) can be used to display alphanumeric characters or even custom char like smiley face, heart, arrows..etc.

createChar() function is to create a custom character for use on the LCD. Up to eight characters of 5x8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes.

Syntax

lcd.createChar(num, data)

Parameters

lcd: a variable of type LiquidCrystal

num: which character to create (0 to 7)

data: the character's pixel data

 

Program code

#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); byte customchar[8]= { B00000, B00000, B01010, B11111, B11111, B01110, B00100, B00000 };

void setup() { lcd.begin(16, 2); lcd.clear(); delay(2000); lcd.createChar(1, customchar); }

void loop() { for(int y=2; y<14; y++){ lcd.setCursor(y,0); lcd.write(1); delay(500); } lcd.clear(); lcd.setCursor(2,0); lcd.print("Happy Eid :)"); lcd.noCursor(); delay(3000); lcd.setCursor(2,1); lcd.print("Uncle Omar"); lcd.noCursor(); delay(3000); lcd.clear(); lcd.setCursor(4,0); lcd.print("I Love U"); lcd.noCursor(); delay(3000); lcd.clear(); }

 

INGREDIENTS : LCD screen, potentiometer, 220 OHM resistor, 10 kilohm resistor, wires.

العلامات:

Recent Posts
Archive
Search By Tags
bottom of page