0

External Interrupts
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

External Interrupts

by NerdFighter on Fri Jan 12, 2018 6:52 pm

Hi! I'm working on a project with a Trinket M0 and a vibration sensor as input. I would like to configure one of the IO pins as an interrupt line to make sure I detect the vibration sensor's very brief state changes regardless of when the occur during my program loop. Are there any existing CircuitPython libraries for simple interrupts on the Trinket M0?

NerdFighter
 
Posts: 21
Joined: Fri Jan 02, 2015 6:24 am

Re: External Interrupts

by adafruit_support_carter on Fri Jan 12, 2018 7:06 pm

Sorry, no. CircuitPython does not (currently) support interrupts. The current focus is on making it a good experience for beginners that have never programmed.

adafruit_support_carter
 
Posts: 5381
Joined: Tue Nov 29, 2016 2:45 pm

Re: External Interrupts

by tannewt2 on Sat Jan 13, 2018 1:47 pm

NerdFighter, You could use pulsio.PulseIn to track if pulses have happened. It has a circular buffer so you won't likely miss the event and uses interrupts internally. Make sure you have 2.2.0 installed. It wasn't available for trinket until 2.1.0.

tannewt2
 
Posts: 695
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.