Hi I am making a project that uses the serial monitor to put in a password that is right now "test" and then it will change a variable also if you enter "1" it will give you the status of the variable that is linked to the password. it all works but it is very delayed I was wondering what I was doing wrong
Thanks
int Password = 0;
void setup() {
// Turn the Serial Protocol ON
Serial.begin(9600);
Serial.println("Initialized");
}
void loop() {
if (Serial.readString() == "test") {
Serial.println("Password Correct");
Password = 1;
}
if (Serial.readString() == "1") {
Serial.print("Password = ");
Serial.println(Password);
Serial.println("Ready");
}
}
sketch_nov21c.ino (374 Bytes)