Hi.
I have two arrays:
// Keep the current matrix setup.
unsigned char buffer[8] = { B00000000,
B00011100,
B00110100,
B00010000,
B00110110,
B00000010,
B00010100,
B00011100
};
// Keep the next life cycle.
unsigned char buffer2[8] = {B00001000,
B00110100,
B00100100,
B00000110,
B00111110,
B00110010,
B00010110,
B00010100
};
I need to check if they hold the same variables in each position (if they are equal).
My code for doing so is like this:
boolean isSame(){
for(int i = 0; i < 8; i++){
if(!buffer[i] == buffer2[i]){
return false;
}
}
return true;
}
But sometimes it gives false results.
The arrays that I give as an example return true. They should return false.
I am not sure what is going on here.
Maybe I have been working for too long.
Can someone spot what I am doing wrong or provide me with another way of checking for equallity?
Thanks.