Write Any Thing on LCD With One Button With Arduino Its a Game
by awaiskhawar in Circuits > Arduino
1713 Views, 9 Favorites, 0 Comments
Write Any Thing on LCD With One Button With Arduino Its a Game
In this project i use only one on button to write any thing on LCD
to write letter A press one time
to write letter B press two times
to write letter C press three times
and so on up to Z
to give space press 27 times
for back sapce press 28 times
its a game
Parts Required for Making
1 arduino
1 LCD
Jumper wires
1 push button
bread board
Assembly of Parts
in this project you can assemble parts lie this
in the picture there are two main things
one lcd
one push button
Game for One Line
in this code you can write program only for second row
int r = 0;
int le = 0 ; int timer = 1000;#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int sw1 = 6; void setup() { lcd.begin(16, 2); lcd.print("Write Name"); pinMode(sw1, INPUT); digitalWrite(sw1, HIGH); lcd.setCursor(0, 1); lcd.print("0"); }
void loop() { if(digitalRead(sw1) == LOW) {
le = le + 1; delay(timer); if(le == 1) { delay(1000); lcd.setCursor(r, 1); lcd.print("A"); } if(le == 2) { delay(timer); lcd.setCursor(r, 1); lcd.print("B"); } if(le == 3) { delay(timer); lcd.setCursor(r, 1); lcd.print("C"); } if(le == 4) { delay(timer); lcd.setCursor(r, 1); lcd.print("D"); } if(le == 5) { delay(timer); lcd.setCursor(r, 1); lcd.print("E"); } if(le == 6) { delay(timer); lcd.setCursor(r, 1); lcd.print("F"); } if(le == 7) { delay(timer); lcd.setCursor(r, 1); lcd.print("G"); } if(le == 8) { delay(timer); lcd.setCursor(r, 1); lcd.print("H"); } if(le == 9) { delay(timer); lcd.setCursor(r, 1); lcd.print("I"); } if(le == 10) { delay(timer); lcd.setCursor(r, 1); lcd.print("J"); } if(le == 11) { delay(timer); lcd.setCursor(r, 1); lcd.print("K"); } if(le == 12) { delay(timer); lcd.setCursor(r, 1); lcd.print("L"); } if(le == 13) { delay(timer); lcd.setCursor(r, 1); lcd.print("M"); } if(le == 14) { delay(timer); lcd.setCursor(r, 1); lcd.print("N"); } if(le == 15) { delay(timer); lcd.setCursor(r, 1); lcd.print("O"); } if(le == 16) { delay(timer); lcd.setCursor(r, 1); lcd.print("P"); } if(le == 17) { delay(timer); lcd.setCursor(r, 1); lcd.print("Q"); } if(le == 18) { delay(timer); lcd.setCursor(r, 1); lcd.print("R"); } if(le == 19) { delay(timer); lcd.setCursor(r, 1); lcd.print("S"); } if(le == 20) { delay(timer); lcd.setCursor(r, 1); lcd.print("T"); } if(le == 21) { delay(timer); lcd.setCursor(r, 1); lcd.print("U"); } if(le == 22) { delay(timer); lcd.setCursor(r, 1); lcd.print("V"); } if(le == 23) { delay(timer); lcd.setCursor(r, 1); lcd.print("W"); } if(le == 24) { delay(timer); lcd.setCursor(r, 1); lcd.print("X"); } if(le == 25) { delay(timer); lcd.setCursor(r, 1); lcd.print("Y"); } if(le == 26) { delay(timer); lcd.setCursor(r, 1); lcd.print("Z"); } if(le == 27) { lcd.setCursor(r, 1); lcd.print("<"); delay(timer); lcd.setCursor(r, 1); lcd.print(" "); } if(le == 28) { lcd.setCursor(r, 1); lcd.print("-"); delay(timer); r = r - 1; lcd.setCursor(r, 1); lcd.print(" "); r = r - 1; } if(digitalRead(sw1) == HIGH){ r = r + 1; le = 0 ; } } }
Downloads
How to Operate One Line Lcd Disaplay
to write letter A press one time
to write letter B press one time
to write letter C press one time
and so on up to Z
to give space press 27 times
for back sapce press 28 times
its a game
Now Game for Full Screen
now you can operate full screen by using one button
int r = 0;
int le = 0 ; int timer = 200; int c =0;#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int sw1 = 6; void setup() { lcd.begin(16, 2); pinMode(sw1, INPUT); digitalWrite(sw1, HIGH); lcd.setCursor(c, r); lcd.noCursor(); delay(timer); lcd.cursor(); delay(timer); }
void loop() { if(digitalRead(sw1) == LOW) {
le = le + 1; delay(timer); if(le == 1) { delay(1000); lcd.setCursor(c, r); lcd.print("A"); } if(le == 2) { delay(timer); lcd.setCursor(c, r); lcd.print("B"); } if(le == 3) { delay(timer); lcd.setCursor(c, r); lcd.print("C"); } if(le == 4) { delay(timer); lcd.setCursor(c, r); lcd.print("D"); } if(le == 5) { delay(timer); lcd.setCursor(c, r); lcd.print("E"); } if(le == 6) { delay(timer); lcd.setCursor(c, r); lcd.print("F"); } if(le == 7) { delay(timer); lcd.setCursor(c, r); lcd.print("G"); } if(le == 8) { delay(timer); lcd.setCursor(c, r); lcd.print("H"); } if(le == 9) { delay(timer); lcd.setCursor(c, r); lcd.print("I"); } if(le == 10) { delay(timer); lcd.setCursor(c, r); lcd.print("J"); } if(le == 11) { delay(timer); lcd.setCursor(c, r); lcd.print("K"); } if(le == 12) { delay(timer); lcd.setCursor(c, r); lcd.print("L"); } if(le == 13) { delay(timer); lcd.setCursor(c, r); lcd.print("M"); } if(le == 14) { delay(timer); lcd.setCursor(c, r); lcd.print("N"); } if(le == 15) { delay(timer); lcd.setCursor(c, r); lcd.print("O"); } if(le == 16) { delay(timer); lcd.setCursor(c, r); lcd.print("P"); } if(le == 17) { delay(timer); lcd.setCursor(c, r); lcd.print("Q"); } if(le == 18) { delay(timer); lcd.setCursor(c, r); lcd.print("R"); } if(le == 19) { delay(timer); lcd.setCursor(c, r); lcd.print("S"); } if(le == 20) { delay(timer); lcd.setCursor(c, r); lcd.print("T"); } if(le == 21) { delay(timer); lcd.setCursor(c, r); lcd.print("U"); } if(le == 22) { delay(timer); lcd.setCursor(c, r); lcd.print("V"); } if(le == 23) { delay(timer); lcd.setCursor(c, r); lcd.print("W"); } if(le == 24) { delay(timer); lcd.setCursor(c, r); lcd.print("X"); } if(le == 25) { delay(timer); lcd.setCursor(c, r); lcd.print("Y"); } if(le == 26) { delay(timer); lcd.setCursor(c, r); lcd.print("Z"); } if(le == 27) { lcd.setCursor(c, r); lcd.print("<"); delay(timer); lcd.setCursor(c, r); lcd.print(" "); } if(le == 28) { lcd.setCursor(c, r); lcd.print("-"); delay(timer); c = c - 1; lcd.setCursor(c, r); lcd.print(" "); c = c - 1; } if(digitalRead(sw1) == HIGH){ c = c + 1; le = 0 ; } if(c == 16) { r = r + 1; c = 0; } } }
Downloads
How to Operate Full Screen
Letter format is same
its start from first row and column
when you have to go to second row
first fill first row and then second can be fill
To Save Lcd Written Data I Use Eeprom
now to save data that is written on lcd i use eeprom
this function is very use full
#include <EEPROM.h>
int r = 0; int le = 0 ; int timer = 500; int c =0;
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int sw1 = 6; void setup() { lcd.begin(16, 2); pinMode(sw1, INPUT); digitalWrite(sw1, HIGH); lcd.setCursor(c, r); lcd.noCursor(); delay(timer); lcd.cursor(); delay(timer); for( int er1 = 0 ; er1 <= 15 ; er1++){ timer = 0; le = EEPROM.read(c); r =0; if(le == 1) { delay(1000); lcd.setCursor(c, r); lcd.print("A"); } if(le == 2) { delay(timer); lcd.setCursor(c, r); lcd.print("B"); } if(le == 3) { delay(timer); lcd.setCursor(c, r); lcd.print("C"); } if(le == 4) { delay(timer); lcd.setCursor(c, r); lcd.print("D"); } if(le == 5) { delay(timer); lcd.setCursor(c, r); lcd.print("E"); } if(le == 6) { delay(timer); lcd.setCursor(c, r); lcd.print("F"); } if(le == 7) { delay(timer); lcd.setCursor(c, r); lcd.print("G"); } if(le == 8) { delay(timer); lcd.setCursor(c, r); lcd.print("H"); } if(le == 9) { delay(timer); lcd.setCursor(c, r); lcd.print("I"); } if(le == 10) { delay(timer); lcd.setCursor(c, r); lcd.print("J"); } if(le == 11) { delay(timer); lcd.setCursor(c, r); lcd.print("K"); } if(le == 12) { delay(timer); lcd.setCursor(c, r); lcd.print("L"); } if(le == 13) { delay(timer); lcd.setCursor(c, r); lcd.print("M"); } if(le == 14) { delay(timer); lcd.setCursor(c, r); lcd.print("N"); } if(le == 15) { delay(timer); lcd.setCursor(c, r); lcd.print("O"); } if(le == 16) { delay(timer); lcd.setCursor(c, r); lcd.print("P"); } if(le == 17) { delay(timer); lcd.setCursor(c, r); lcd.print("Q"); } if(le == 18) { delay(timer); lcd.setCursor(c, r); lcd.print("R"); } if(le == 19) { delay(timer); lcd.setCursor(c, r); lcd.print("S"); } if(le == 20) { delay(timer); lcd.setCursor(c, r); lcd.print("T"); } if(le == 21) { delay(timer); lcd.setCursor(c, r); lcd.print("U"); } if(le == 22) { delay(timer); lcd.setCursor(c, r); lcd.print("V"); } if(le == 23) { delay(timer); lcd.setCursor(c, r); lcd.print("W"); } if(le == 24) { delay(timer); lcd.setCursor(c, r); lcd.print("X"); } if(le == 25) { delay(timer); lcd.setCursor(c, r); lcd.print("Y"); } if(le == 26) { delay(timer); lcd.setCursor(c, r); lcd.print("Z"); } if(le == 27) { lcd.setCursor(c, r); lcd.print("<"); delay(timer); lcd.setCursor(c, r); lcd.print(" "); } c = c + 1; } c=0; r=0; lcd.noCursor(); timer = 200 ; }
void loop() { if(digitalRead(sw1) == LOW) {
le = le + 1; delay(timer); if(le == 1) { delay(1000); lcd.setCursor(c, r); lcd.print("A"); } if(le == 2) { delay(timer); lcd.setCursor(c, r); lcd.print("B"); } if(le == 3) { delay(timer); lcd.setCursor(c, r); lcd.print("C"); } if(le == 4) { delay(timer); lcd.setCursor(c, r); lcd.print("D"); } if(le == 5) { delay(timer); lcd.setCursor(c, r); lcd.print("E"); } if(le == 6) { delay(timer); lcd.setCursor(c, r); lcd.print("F"); } if(le == 7) { delay(timer); lcd.setCursor(c, r); lcd.print("G"); } if(le == 8) { delay(timer); lcd.setCursor(c, r); lcd.print("H"); } if(le == 9) { delay(timer); lcd.setCursor(c, r); lcd.print("I"); } if(le == 10) { delay(timer); lcd.setCursor(c, r); lcd.print("J"); } if(le == 11) { delay(timer); lcd.setCursor(c, r); lcd.print("K"); } if(le == 12) { delay(timer); lcd.setCursor(c, r); lcd.print("L"); } if(le == 13) { delay(timer); lcd.setCursor(c, r); lcd.print("M"); } if(le == 14) { delay(timer); lcd.setCursor(c, r); lcd.print("N"); } if(le == 15) { delay(timer); lcd.setCursor(c, r); lcd.print("O"); } if(le == 16) { delay(timer); lcd.setCursor(c, r); lcd.print("P"); } if(le == 17) { delay(timer); lcd.setCursor(c, r); lcd.print("Q"); } if(le == 18) { delay(timer); lcd.setCursor(c, r); lcd.print("R"); } if(le == 19) { delay(timer); lcd.setCursor(c, r); lcd.print("S"); } if(le == 20) { delay(timer); lcd.setCursor(c, r); lcd.print("T"); } if(le == 21) { delay(timer); lcd.setCursor(c, r); lcd.print("U"); } if(le == 22) { delay(timer); lcd.setCursor(c, r); lcd.print("V"); } if(le == 23) { delay(timer); lcd.setCursor(c, r); lcd.print("W"); } if(le == 24) { delay(timer); lcd.setCursor(c, r); lcd.print("X"); } if(le == 25) { delay(timer); lcd.setCursor(c, r); lcd.print("Y"); } if(le == 26) { delay(timer); lcd.setCursor(c, r); lcd.print("Z"); } if(le == 27) { lcd.setCursor(c, r); lcd.print("<"); delay(timer); lcd.setCursor(c, r); lcd.print(" "); } if(le == 28) { lcd.setCursor(c, r); lcd.print("-"); delay(timer); c = c - 1; lcd.setCursor(c, r); lcd.print(" "); c = c - 1; } if(digitalRead(sw1) == HIGH){ if(r == 0 ){ EEPROM.write(c , le); } c = c + 1; le = 0 ; } if(c == 16) { r = r + 1; c = 0; } } }
Downloads
What You Can Do
you can also add numbers
special charactor
and option of capital letters and small small letters
give us feed back and show me that you make