According to Wikipedia:
GPIO capabilities may include:
GPIO pins can be configured to be input or output
GPIO pins can be enabled/disabled
Input values are readable (typically high=1, low=0)
Output values are writable/readable
To my understanding, if a pin is set for input, then it cannot be written. In other words, it is not valid to write a value to an input pin. However, I am not sure whether an output pin is readable.
For example, given a pin numbered 8, after I call function write_pin_value(pin_8, 1);
, does the function call read_pin_value(pin_8)
always return the value 1?