Adafruit MSA301 Interrupt Handling

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
Bluesailor
 
Posts: 1
Joined: Wed Mar 08, 2023 8:54 am

Adafruit MSA301 Interrupt Handling

Post by Bluesailor »

Hi all,
I have added a MSA301 digital triaxial accelerometer to my Raspberry Pi using python. I have installed the adafruit circuit python msa301 library (adafruit_msa3xx.MSA301). To detect taps it is easy to implement with "MSA301.enable_tap_detection()" and "if MSA301.tapped: ... ".
However as this implementation is bound to looping around the if statement, I want to implement the tap detection with interrupt handling (msa301 Interrupt pin is on Raspberry Pi Pin 7 (4 in BCM mode).

possibly around the following definitions: (???)

GPIO.setup(Int_Pin,GPIO.IN)
GPIO.add_event_detect(Int_Pin, GPIO.FALLING, callback= 'callback_routine') ??

Unfortunately I do not find any information on how exactly to handle interrupts with the msa301.

Any help will be greatly appreciated.
Thank you very much.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”