pranavmadhavaram
Published © GPL3+

Pick the random chit digital version

Pick the random chit game version

AdvancedFull instructions provided1,107
Pick the random chit digital version

Things used in this project

Story

Read more

Schematics

website_10_3mNZ8LdJFn.png

Code

Untitled file

Arduino
#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 row pinouts of the keypad
byte pin_column[COLUMN_NUM] = {5, 4, 3, 2}; //connect to the column 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') {     // only act on numeric keys
      inputString += key;               // append new character to input string
    } else if (key == '#') {
      if (inputString.length() > 0) {
        inputInt = inputString.toInt(); // YOU GOT AN INTEGER NUMBER
        inputString = "";               // clear input
        // DO YOUR WORK HERE

      }
    } else if (key == '*') {
      inputString = "";                 // clear input-
    }
  }
 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("Oh lazy 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{
    
  }
  }

Credits

pranavmadhavaram
16 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.