innovationhut
Junior Member level 2
Hi,
I am currently writing a program in which I have to compare the value received from a pin (values read from the pin and stored in variable) with the numbers stored in an array.
For example:
what kind of loop I can use to compare them, all variables and data stored should be equal to set PORTC HIGH, such that D0 should be equal to 0C, D1 to 0A and so on.
I am currently writing a program in which I have to compare the value received from a pin (values read from the pin and stored in variable) with the numbers stored in an array.
For example:
Code:
const char com3[] = {0x0C, 0x0A, 0x0A, 0x0C}; // now compare them with the four variables. D0, D1, D2 and D3
D0 = 0C, D1 = 0X0A, D2 = 0X0A, D3 = 0X0C //so that if they are all equal it should set PORTC high.
what kind of loop I can use to compare them, all variables and data stored should be equal to set PORTC HIGH, such that D0 should be equal to 0C, D1 to 0A and so on.