You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently "pinMode(pin, OUTPUT)" will clear the INEN bit for the GPIO pin in question, preventing digitalRead() (or direct port access) from being able to read the current output state of an output pin, and breaking trivial statements like:
digitalWrite(13, ! digitalRead(13)); // toggle LED
As far as I can tell, there should never be a reason to disable input on the GPIO pins (PORT_PINCFG_INEN bit cleared in pincfg), except maybe when the pin is used for analog input.
Apparently "pinMode(pin, OUTPUT)" will clear the INEN bit for the GPIO pin in question, preventing digitalRead() (or direct port access) from being able to read the current output state of an output pin, and breaking trivial statements like:
digitalWrite(13, ! digitalRead(13)); // toggle LED
As far as I can tell, there should never be a reason to disable input on the GPIO pins (PORT_PINCFG_INEN bit cleared in pincfg), except maybe when the pin is used for analog input.
http://forum.arduino.cc/index.php?topic=367517
The text was updated successfully, but these errors were encountered: