IMU libraries. Or pinmode() mapping?

I want to use the onboard IMU unit for the Rev 2, but so far have found only libraries that use I2C to communicate with an external IMU unit. Does anyone know of libraries to use the Rev2 onboard IMU unit?

A related issue is understanding the mapping of pinmode() to the UC1 output pins. If I know these mappings, then I might be able to modify a LSM6DS library to communicate with the onboard IMU via the output pins of the UC1. Does anyone know where I can find these mappings for pinmode()?

Pin mappings:ATmega4809-pinout - Google Sheets

Did you get the IMU unit to work? If so, would you like to share your resources?

I just recently created an article on how to access the onboard IMU of the Arduino Uno WiFi Rev2 at Accessing The IMU On The New Arduino Uno WiFi Rev2 - Woolsey Workshop.

In a nutshell, you can select the SparkFun LSM6DS3 Breakout by SparkFun Electronics library from within the Library Manager and then change the constructor in the example sketches from

LSM6DS3 myIMU;

to

LSM6DS3 myIMU(SPI_MODE, SPIIMU_SS);

Hope this helps,
jw

Thanks! Gonna check it out!

woolsey:
I just recently created an article on how to access the onboard IMU of the Arduino Uno WiFi Rev2 at Accessing The IMU On The New Arduino Uno WiFi Rev2 - Woolsey Workshop.

In a nutshell, you can select the SparkFun LSM6DS3 Breakout by SparkFun Electronics library from within the Library Manager and then change the constructor in the example sketches from

LSM6DS3 myIMU;

to

LSM6DS3 myIMU(SPI_MODE, SPIIMU_SS);

Hope this helps,
jw

you sure SPIIMU_SS works in the arduino wifi rev2? I used this with no problems until i noticed that the IMU was interfering with pin 10 - delving a bit deeper, it seems that 10 is the default pin in the sparkfun library for the IMU. I couldnt find the the definition for SPIIMU_SS in any of the headers... i imagine that SPIIMU_SS is undefined and it resorts to default, pin 10. I will try and add portb3 directly and see if that releases pin 10 to be used as normal

edit: i found SPIIMU_SS in pins_arduino. So bit of a mystery why using this is interfering with pin 10. Any ideas? Pin 10 is the default for the CS pin in the sparkfun library

I don't know why there seems to be some interference with pin 10. I found the SPIIMU_SS reference within the Getting started with the Arduino Uno WiFi Rev2 documentation along with being defined inside the pins_arduino.h file of the uno2018 board specific library. Sorry I could not help further.

thanks anyway woolsey - it wasnt till i decided to use pin 10 that i noticed... thought the SPIIMU_SS definition was working.

not a major problem anyway