Westpol
Published

Password Saver

This tiny project is made to log in faster and easier. And btw this is not my actual password.

BeginnerFull instructions provided2,773
Password Saver

Things used in this project

Story

Read more

Code

Password_Writer.ino

C/C++
In this code, you only have to replace the line 28 and 32 with your accounts and then lines 46 and 50 with the according passwords.
int menu;
int PrevMenuState;

int button = 11;    // the pin, which the button is attached on
/* For the analog input, I couldn't use a variable, because of the A for analog,
so you have to correct some lines
the lines are:14,20 */

int passwords = 2;  // numbers of passwords/accounts

void setup() {
  Serial.begin(9600);
  pinMode(button,INPUT_PULLUP);
  pinMode(A5,INPUT);
  PrevMenuState = 2;
}

void loop() {
  
  menu = map(analogRead(A5),0,1024,0,passwords);   // converts the 1024 steps into tinier steps

  if(menu != PrevMenuState){



    
    if(menu == 0){
      Serial.println("Your account which the password is for1");    
      
    }
    if(menu == 1){
      Serial.println("Your account which the password is for2");    
    }
/*    if(menu == 2){    // for 3 accounts just undo the block comment and add 1 to the passwords int
      Serial.println("Your account which the password is for3");    
    }*/
     PrevMenuState = menu;
     
  }




  if(digitalRead(button) == LOW){
    if(menu == 0){
      Serial.println("password1 "); 
      while(digitalRead(button) == LOW){}
    }
    if(menu == 1){
      Serial.println("password2 ");    
      while(digitalRead(button) == LOW){}
    }
/*    if(menu == 2){
      Serial.println("password3 ");    /    // for 3 accounts just undo the block comment and add 1 to the passwords int
      while(digitalRead(button) == LOW){}
        
    }*/
    
  }
  
}

Credits

Westpol
8 projects • 22 followers
Contact

Comments

Please log in or sign up to comment.