Hi all,
I want to capture a serial digital input and storate it like a byte, after this I want to compare it with a variable that I have.
My problem is:
I storate input in an array like this
uint8_t array[7];
for(i=0;i<8;i++)
array = digitalRead(pin);
After this I want to compare this array with a variable I have, something like this:
if(myvariable == array)
Serial.print("Same");
What I ask is, how I can do that in an efficient way?
- There is a library that can do that?
- Can I consider myvariable like an array and read a single bit?
- Can I storate input data in a variable without use an array?