mrjohnk / PMW3360DM-T2QU

https://www.tindie.com/products/jkicklighter/pmw3360dm-t2qu-motion-sensor/
75 stars 21 forks source link

Using INT1 instead of INT0 #12

Open kabrio opened 6 years ago

kabrio commented 6 years ago
//Set this to what pin your "INT0" hardware interrupt feature is on
#define Motion_Interrupt_Pin 1

I am trying to use the senor with an Teensy 2.0++ I was wondering if it is also possible to use INT1 instead of INT0.

kabrio commented 6 years ago

After some more tests: I guess not. Interesting (to me at least) even if I set Motion_Interrupt_Pin to INT1 in code, I only get values from sensor when I connect MT to INT0.

mrjohnk commented 6 years ago

I have used different interrupts on the Teensy 2.0 before with no problem. You just need to hook to the correct related pin and indicate which interrupt to watch for on the attachInterrupt line in the code. Also don't forget to raise the pull-up on that pin in input mode.

On Feb 13, 2018 8:09 AM, "kabrio" notifications@github.com wrote:

After some more tests: I guess not. Interesting (to me at least) even if I set Motion_Interrupt_Pin to INT1 in code, I only get values from sensor when I connect MT to INT0.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrjohnk/PMW3360DM-T2QU/issues/12#issuecomment-365276894, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-UL4TWcZTVBSqqQripfK0NSTUs4Bks5tUZd5gaJpZM4SDjcr .

kabrio commented 6 years ago

Thanks for the answer! Looked into the code again and I think the problem is on line 76. There is 0 hardcoded where probably should be _Motion_InterruptPin used instead. Now works with other interrupts than 0 too!