8 years, 10 months ago.

InterruptIn object has PinMode method ::mode() - but what is default pin mode? up/down/none

Not to nit pick, but if you were following "Rational" OO design methodology, you would have a private member set to a safe default of some kind. This clearly isn't the case here so it begs the question: what is the default mode for the pin?

Question relating to:

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

1 Answer

8 years, 10 months ago.

The default mode of the pin is PullDefault. What PullDefault is, depends on your target. And while this isn't perfect, the problem is that not every target supports each option.

Accepted Answer

I appreciate the answer. Did I miss this in the docs somewhere or did you dig through deep below the InterruptIn source code to determine this?

posted by Noneya Business 26 Jan 2016

The second option. I am quite familiar with the mbed source code, so I just had to double check it. There are some things lacking in the documentation (if the documentation is functional in the first place).

posted by Erik - 26 Jan 2016