#include // Loads keyboard library char* strPassword[5] = {"Password_1", "Password_2", "Password_3","Password_4","Password_5"}; // Passwords to be written char* strDelimited[5] = {"Pa******_1", "Pa******_2", "Pa******_3","Pa******_4","Pa******_5"}; // Passwords as displayed in serial monitor int ButtonCounter, ButtonState, LastState; const int Button1 = 11; // Digital pin 11 as Button1 const int Button2 = 10; // Digital pin 10 as Button2 void setup(){ Keyboard.begin(); // Initiates keyboard pinMode(Button1, INPUT); pinMode(Button2, INPUT); Serial.begin(9600); } void loop(){ ButtonState = digitalRead(Button1); // Reads button 1 high or low state if (ButtonState == HIGH && ButtonState != LastState){ // If statement to count button clicks ButtonCounter++; } LastState = ButtonState; // Selects option from number button clicks switch (ButtonCounter){ case 0: PrintText(); break; case 1: PrintText(); break; case 2: PrintText(); break; case 3: PrintText(); break; case 4: PrintText(); break; case 5: ButtonCounter = 0; // Resets button to start selection over break; } } void PrintText(){ // Loop to send text with button 2 Serial.println(strDelimited[ButtonCounter]); if( digitalRead(10) == HIGH){ Keyboard.println(strPassword[ButtonCounter]); delay(100); } delay(100); }