sipeed / Maixduino

Arduino port on Maix board ( k210 )
https://maixduino.sipeed.com
Other
215 stars 95 forks source link

Digital pins don't work as inputs until pinMode is called #78

Open technoblogy opened 4 years ago

technoblogy commented 4 years ago

As stated in the Maixduino documentation:

Only pins that are set to the input function by pinMode() can be read.

This is different from the standard Arduino behaviour. Why don't you incorporate a call to:

pinMode(pin, INPUT);

in the digitalRead() function? This would then make the behaviour consistent.