3 months, 2 weeks 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.

Comment on this question

1 Answer

3 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)};


You need to log in to post a question