I have a few questions about the Arduino library functions for setting digital I/O pin mode and writing values.
- The function pinMode(pin, INPUT or OUTPUT) sets whether a pin is an input or output. Is there a corresponding way to read what the pinMode is for a given pin?
- If I try to use digitalWrite() to a pin that has been configured as an input, does anything bad happen or is it just ignored?
- The function digitalWrite() sets one pin to either HIGH or LOW. Is there a similar function to write all the pin values at once, or perhaps 8 at a time?