char ch[]={'1','2','3','4'};
//values sent through bluetooth and stored in c variable (c is the input given from android) and then it checks d if else condition which is below
if(c[0]==ch[0] && c[1]==ch[1] && c[2]==ch[2] && c[3]==ch[3]){ // variable c is taken from bluetooth and ch variable values are already saved and stored
Serial.println("CORRECT PASSWORD");
delay(5000);
}
else{
Serial.println("WRONG PASSWORD....");
delay(2000);
flag+=1;
}
when i print values of c and ch , the values corresponding to d same index are same but still when i give it as a condition it is not working
Gabriel_swe:
Te
Tell a computer to print ascii 31, it will look exactly the same as numerical value 1, but it isn't. Try abcd as password to prevent mixup.
ASCII 31 (Unit Separator) is normally invisible. ASCII 49 (0x31) on the other hand, looks a lot like a one digit.