8 years, 9 months ago.

InterruptIn on pin change on Nucleo F401

I would like to define an InterruptIn on pin status change but InterruptIn.change() is not available, only .rise or .fall. Now I have used this method :

PinA.fall(&doPinA);
PinA.rise(&doPinA);
PinA.mode(PullUp);    

Can anyone confirm that this is the way to get an interrupt on change ?

Thanks.

1 Answer

8 years, 9 months ago.

That should work yes, and indeed there is no specific pin change interrupt. What is your use case?

I'm porting a piece of code from an Arduino project to the Nucleo. It contains rotary encoder routines that rely on interrupt on change. So that triggered my search for the mbed way to do this.

posted by Roland Kamp 25 Jul 2015