Go Down

Topic: IMU libraries. Or pinmode() mapping? (Read 1 time) previous topic - next topic

MIKEMARTENS2011

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()?

 

 

westfw


JanZuiderveld

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

woolsey

I just recently created an article on how to access the onboard IMU of the Arduino Uno WiFi Rev2 at https://www.woolseyworkshop.com/2019/01/23/accessing-the-imu-on-the-new-arduino-uno-wifi-rev2/.

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

JanZuiderveld


jcj99

#5
Mar 31, 2019, 11:42 pm Last Edit: Apr 01, 2019, 12:02 am by jcj99
I just recently created an article on how to access the onboard IMU of the Arduino Uno WiFi Rev2 at https://www.woolseyworkshop.com/2019/01/23/accessing-the-imu-on-the-new-arduino-uno-wifi-rev2/.

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

woolsey

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.

jcj99

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

Go Up