4 years, 9 months ago.

Initialization list of InterruptIn

How can a list of InterruptIn pins be defined without explicitly setting each as a separate name?

``` class Test { InterruptIn pins[3]; Test(PinName p1, PinName p2, PinName p3): pins{p1, p2, p3} {} }; ```

The fact that they're NonCopyable seems to prevent this on debug builds.

1 Answer

4 years, 8 months ago.

Hi there,

do you mean something like this?

include the mbed library with this snippet

InterruptIn pins[]= {InterruptIn(A0), InterruptIn(A1), InterruptIn(A2)};

BR J.