Hey everyone. In some events, a game is organized where the player is asked to pick a chit from the bowl and gets a task which the participants have to do. But taking chits from bowl, writing chits is old and not for the digital generation. so let’s make it digital using arduino
Connections:
1) Row pins to 3, 6, 7, 8
2) Col pins to 9, 10, 1, 13
3) LCD RSpin to digital pin 12
4) LCD Enable pin to digital pin 11
5) LCD D4 pin to digital pin 5
6) LCD D5 pin to digital pin 4
7) LCD D7 pin to digital pin 2
8) LCD R/Wpin to ground
9) LCD VSS pin to ground
10) LCD VCC pin to 5V LCD D6 pin to digital pin 3
11)
12) * 10K resistor:
13) ends to +5V and ground
14) wiper to LCD VO pin (pin 3)
code:
#include <LiquidCrystal.h>
#include <Keypad.h>
const int ROW_NUM = 4; //four rows
const int COLUMN_NUM = 4; //four columns
char keys[ROW_NUM][COLUMN_NUM] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte pin_rows[ROW_NUM] = {9, 8, 7, 6}; //connect to the rowpinouts of the keypad
byte pin_column[COLUMN_NUM] = {5, 4, 3, 2}; //connect to thecolumn pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );
String inputString;
long inputInt;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
inputString.reserve(10);
}
void loop() {
char key =keypad.getKey();
if (key) {
Serial.println(key);
if (key >= '0'&& key <= '9') { // onlyact on numeric keys
inputString +=key; // append newcharacter to input string
} else if (key =='#') {
if(inputString.length() > 0) {
inputInt =inputString.toInt(); // YOU GOT AN INTEGER NUMBER
inputString =""; // clearinput
// DO YOURWORK HERE
}
} else if (key == '*'){
inputString =""; // clearinput-
}
}
if (key==1){
lcd.print("Jump on one leg for 10 times ");}
else if (key==2){
lcd.print("Sing an fast English song ");}
else if (key==3){
lcd.print("Left leg dance ");}
else if (key==4){
lcd.print("Say I am a donkey 10 ten time");}
else if (key==5){
lcd.print("Dab with legs or call your self buffalo");}
else if (key==6){
lcd.print("Make a magic tricks");}
else if (key==7){
lcd.print("sorry donkeys dont get a task");}
else if (key==8){
lcd.print("Ohlazy buffalo don’t do any task");}
else if (key==9){
lcd.print("5.Act like charlin chaplin");}
else if (key==10){
lcd.print("6.Sing rap");}
else{
}
}
ADVERTIZEMENT:
**********************Don’t skip**************************
Are you interested in making your own arduino project and rely on my sources.
If you rely on my sources then you might have your own ideas that neither I have not uploaded or nor others. So I will help you out personally in making your project. Yes you heard it right. I will complete your project. All you need is just to press this link.
https://www.freelancer.in/hireme/pranavmadhavaram
*****************advertisement completed******************
How to operate:
Press any number from 1 to 10 get your task
If you press 1 your task is "Jump on one leg for 10 times "
If you press 2 your task is "Sing an fast English song "
If you press 3 your task is "Left leg dance"
If you press 4 your task is " Say I am a donkey 10 ten times"
If you press 5 your task is " Dab with legs or call your self buffalo"
If you press 6 your task is " Make a magic tricks"
If you press 7 your task is " sorry donkeys dont get a task"
If you press 8 your task is " Oh lazy buffalo don’t do any task"
If you press 9 your task is " Act like charlin chaplin"
If you press 10 your task is " Sing rap" how to change the task or add another task:
When you want to change task all you do is go to the line if (key== or else if (key==
And there will be a number in that line. That is the key of which task will be given and below that and the characters in the line between“ will be displayed. To change it just replace the characters between have to be replaced and to add others add this code
else if (key==x){
lcd.print("y");}
replace y with task you want and x with the number that you want to add such that when you press it the task appears
Comments
Please log in or sign up to comment.