Hello, I have just started with Arduino and am looking to make an edit to some code a friend wrote.
In some parts the code, user has the option to enter a password, right now they are forced to enter an 8 digit number. I would like to reduce this to a 4 digit number.
I figured I would ask for advice here , before making that change and causing myself issues down the line.
Do I simply change the [8] to [4] and the for(int i=0;i<8;i++){ to for(int i=0;i<4;i++){
Thanks in advance.
In the code I have this :
//This fuction compare codeInput[8] and password[8] variables
boolean comparePassword(){
for(int i=0;i<8;i++){
if(codeInput[i]!=password[i])return false;
}
return true;
}
//Set the password variable
void setCode(){
lcd.setCursor(0, 1);
for(int i=0;i<8;i++){
while(1){
var= getNumber();
if(var !='x'){
codeInput[i] = var;
if (i != 0){
lcd.setCursor(i-1,1);
lcd.print("*");
lcd.print(var);
}
else
{
lcd.print(var);
}
tone(tonepin,2400,30);
break;
}
}
}
}