Arduino Keyboard Password

(CLICK TITLE FOR MORE)


This time, I've made another project on my Arduino Uno. This time it's about customizable passwords that I can program on it. I've used a bare connection to the:

Arduino Uno

to make my project work again. Below would be the sketch for this project :




int serial_in;
int no;
int code;
int a;
int b;
int c;


void setup()
{
  Serial.begin(9600);
}


void loop()

  if(Serial.available()){                            // wait until there was signal send from computer
  serial_in = Serial.read();                     // Receive signal in ASCII
  no++;
  if(code==123){                                                                              // password is 123
    Serial.print("ACCESS CLEAR    PASSWORD:");               
    Serial.println(code); 
  }
  else{
    Serial.print("ACCESS DENIED   PASSWORD:"); 
    Serial.println(code); 
  }
  }
    
 code=100*a+10*b+c;                 
   
if(no==1){
  switch(serial_in){
    case '0':
    a=0;
    break;
    case '1':
    a=1;
    break;
    case '2':
    a=2;
    break;
    case '3':
    a=3;
    break;
    case '4':
    a=4;
    break;
    case '5':
    a=5;
    break;
    case '6':
    a=6;
    break;
    case '7':
    a=7;
    break;
    case '8':
    a=8;
    break;
    case '9':
    a=9;
    break;
  }
}
  if(no==3){
    switch(serial_in){
    case '0':
    b=0;
    break;
    case '1':
    b=1;
    break;
    case '2':
    b=2;
    break;
    case '3':
    b=3;
    break;
    case '4':
    b=4;
    break;
    case '5':
    b=5;
    break;
    case '6':
    b=6;
    break;
    case '7':
    b=7;
    break;
    case '8':
    b=8;
    break;
    case '9':
    b=9;
    break;
  }
  }
  if(no==5){
    switch(serial_in){
    case '0':
    c=0;
    break;
    case '1':
    c=1;
    break;
    case '2':
    c=2;
    break;
    case '3':
    c=3;
    break;
    case '4':
    c=4;
    break;
    case '5':
    c=5;
    break;
    case '6':
    c=6;
    break;
    case '7':
    c=7;
    break;
    case '8':
    c=8;
    break;
    case '9':
    c=9;
    break;
   }
  }
  
}

And how does it work? Check out the video below! Enjoy





by Weng Fei

One Response so far.

  1. Unknown says:

    The casino casino hotel at Harrah's and the LINQ - Air Jordan
    The where to buy air jordan 18 retro men casino hotel at Harrah's and the show jordan 18 white royal blue LINQ Hotel in Las Vegas air jordan 18 retro men red online is the where to get air jordan 18 stockx most beautiful place to be if you're going to buy air jordan 18 retro yellow suede visit the action at the

Leave a Reply

Popular Posts