bolderflight / invensense-imu

Arduino and CMake library for communicating with the InvenSense MPU-6500, MPU-9250 and MPU-9255 nine-axis IMUs.
MIT License
508 stars 213 forks source link

To work with Teensy 4.x #64

Closed mjs513 closed 3 years ago

mjs513 commented 4 years ago

Brian This PR is to fix an issue with the library working the Teensy 4.0. If you look at the thread https://forum.pjrc.com/threads/58688-Teensy-4-0-Clock-speed-influences-delay-and-SPI you can see the whole history.

To get it working I modified writeregs and readregs to use digitalwritefast's and added 200 nanosecond delays after going low and going high. I wrapped the changed functions in an if def for the imxrt1062.

flybrianfly commented 4 years ago

Thanks! I'll test this when I can and pull - likely early in January.

mjs513 commented 4 years ago

Wow, that was fast:) not a problem. There might be a better way.. but this works.

flybrianfly commented 3 years ago

Updated the library and it works with Teensy 4.x now.