- Tue Sep 27, 2011 11:10 pm
#133948
Is there a way to read multiple digital pins with one function call?
I think digitalRead/digitalWrite are actually reading the entire 8 bits of one parallel port,
and just masking off all bits except for the one passed as an argument to digitalRead/digitalWrite call.
The reason I need to do this is because my Arduino is monitoring 4 digital input pins,
and I want to make sure that only 1 pin changes at any one time.
The only way to do that is to read them all at once.
Can this be done using the Arduino language?
I think digitalRead/digitalWrite are actually reading the entire 8 bits of one parallel port,
and just masking off all bits except for the one passed as an argument to digitalRead/digitalWrite call.
The reason I need to do this is because my Arduino is monitoring 4 digital input pins,
and I want to make sure that only 1 pin changes at any one time.
The only way to do that is to read them all at once.
Can this be done using the Arduino language?