micropython-IMU / micropython-mpu9x50

Drivers for InvenSense inertial measurement units MPU9250, MPU9150, MPU6050
MIT License
260 stars 82 forks source link

INT pin? #23

Closed ser closed 3 years ago

ser commented 3 years ago

ANy suggestions how to use this library utilising INT pin on MPU 9250? I would like to use Motion Detection notifications - how can I receive them? image

peterhinch commented 3 years ago

This is a feature I'm aware of, but have never studied for use. My applications for IMU's use asynchronous programming with uasyncio. In this context detecting motion is easy. Run a task which periodically compares current values with prior ones and triggers an Event. See uasyncio tutorial.

It rather depends on why you want to use the INT. The way which makes most sense is as a means of exiting deepsleep. The deepsleep mechanism is platform dependent, so any solution will need some research.

In any event you'll need to program the INT mechanism explicitly. I have no plans to integrate this into the driver.