9 Degrees of Freedom IMU can be used as a fly control board. The detailed info can be found at LinkSprite WiKi. This tutorial how to make IMU talk to pcDuino.
- 9 Degrees of Freedom IMU Spec
- Wiring Instruction
- How does pcDuino talk to IMU
- 3-axis accelerator test
- 3-axis gyro test
- 3-xias magnetic shield test
- Air pressure test
This is an IMU module that has sensors of 3-axis gyro, 3-axis accelerator, 3-axis magnetic field and air pressure.
The chipset used are L3G4200D+ADXL345+HMC5883L+BMP085.
Supply voltage ranges from 3 to 5V, and the interface is I2C (3-5V).
Module size: 25.8 mm X 16.8 mm.
In this tutorial, the sensors results are output through the UART of pcDuino, and not printed on the screen. So we need a UART to USB converter to transform the results of UART.
On the PC side (which is used to display the UART results), we are using X-CTU:
Configuration: Baud Rate=9600, Data Bits=8, Stop Bits=1
IMU uses I2C interface, and pcDuino also provides I2C API, so it’s fairly easy to make IMU to talk to pcDuino.
We can obtain the latest Arduino API of pcDuino from github.
Next, we are going to show how to port the example codes of IMU ([easy_media_download url=”http://learn.linksprite.com/wp-content/uploads/2013/10/9D-IMU.rar”])on 8051 or STM32 to pcDuino.
1. Copy the four test codes (adxl345_test.c / BMP085_test.c / HMC5883_test.c / L3G4200D_test.c) to directory sample of Arduino API:
2. Copy the library “L3G4200D” to directory libraries under Arduino API: “/home/ubuntu/c_enviroment-master/libraries”.
The library L3G4200D is included in the package 9D-IMU.
3. Enter into Arduino directory “/home/ubuntu/c_enviroment-master” to modify Makefile:
4. Enter into Arduino API directory “sample” to modify Makefile:
5. Enter into terminal to build the library:
ubuntu@ubuntu:~$ cd c_enviroment-master
ubuntu@ubuntu:~/c_enviroment-master $ make
6. Run the code in directory “test”:
ubuntu@ubuntu:~$ cd c_enviroment-master/output/test