(SKU:RB-01C104)Arduino 9 Axes Motion Shield

来自ALSROBOT WiKi
跳转至: 导航搜索
RB01C10401.png

目录

产品概述

Arduino 9轴运动扩展板基于德国博世传感器技术有限公司推出的BNO055绝对方向传感器。 BNO055为系统级封装(SiP),集成三轴14位加速计、三轴16位陀螺仪(每秒±2000度)、三轴地磁传感器和运行BSX3.0 FusionLib 软件的32位微控制器。BNO055有三维加速度、角速度和磁场强度数据,各自在三个垂直的轴上。 另外,它还提供传感器融合信号,如 四元数、欧拉角、旋转矢量、线性加速、重力矢量,此外,它还结合智能中断引擎,可以基于下述各项触发中断,慢动作或误动作识别,任何动作(斜率)检测,高g检测。Arduino 9轴运动扩展板兼容TinkerKit,这意味着你可以通过将TinkerKit模块插入到电路板上快速创建项目。

规格参数

  1. 工作电压:5V
  2. 功耗:50mW
  3. 供电:Arduino 9轴运动扩展板无电源插孔,只有在连接到电路板时才能加电。
  4. TinkerKit 接口:输入2个、输出2个、TWI 2个
  5. 外形尺寸:长*宽为2.7*2.1英寸

接口介绍

输入和输出

Arduino 9轴运动扩展板有数个TinkerKit输入/输出和通信接口。连接TinkerKit模块可以简化项目或原型的创建工作。
板载接口有:

  • 2 个TinkerKit 输入接口: IN2和IN3(白色),这些接口路由到Arduino A2和A3模拟输入引脚。
  • 2 个TinkerKit 输出接口: OUT5和OUT6(橙色),这些接口路由到引脚5和6上的Arduino PWM输出端口。
  • 2 个TinkerKit TWI: 这些接口(4引脚,白色)在Arduino TWI接口上进行路由。两个都连接到相同的TWI接口,让你可以创建一连串的TWI设备。

兼容性

Arduino 9轴运动扩展板兼容Uno、Yùn、Leonardo、Ethernet、Mega和Due电路板。在使用Arduino 9轴运动扩展板时,一定要根据使用的电路板将中断桥和重置桥焊接在正确位置。见下表:

RB01C10402.png

例子程序

以下为传送加速度计数据的示例代码

#include "NAxisMotion.h"        //Contains the bridge code between the API and the Arduino Environment
#include <Wire.h>

NAxisMotion mySensor;                 //Object that for the sensor
unsigned long lastStreamTime = 0;     //To store the last streamed time stamp
const int streamPeriod = 40;          //To stream at 25Hz without using additional timers (time period(ms) =1000/frequency(Hz))
bool updateSensorData = true;         //Flag to update the sensor data. Default is true to perform the first read before the first stream

void setup() //This code is executed once
{
  //Peripheral Initialization
  Serial.begin(115200);           //Initialize the Serial Port to view information on the Serial Monitor
  I2C.begin();                    //Initialize I2C communication to the let the library communicate with the sensor. 
  //Sensor Initialization
  mySensor.initSensor();          //The I2C Address can be changed here inside this function in the library
  mySensor.setOperationMode(OPERATION_MODE_NDOF);   //Can be configured to other operation modes as desired
  mySensor.setUpdateMode(MANUAL);	//The default is AUTO. Changing to manual requires calling the relevant update functions prior to calling the read functions
  //Setting to MANUAL requires lesser reads to the sensor
  mySensor.updateAccelConfig();
  updateSensorData = true;
  Serial.println();
  Serial.println("Default accelerometer configuration settings...");
  Serial.print("Range: ");
  Serial.println(mySensor.readAccelRange());
  Serial.print("Bandwidth: ");
  Serial.println(mySensor.readAccelBandwidth());
  Serial.print("Power Mode: ");
  Serial.println(mySensor.readAccelPowerMode());
  Serial.println("Streaming in ...");	//Countdown
  Serial.print("3...");
  delay(1000);	//Wait for a second
  Serial.print("2...");
  delay(1000);	//Wait for a second
  Serial.println("1...");
  delay(1000);	//Wait for a second
}

void loop() //This code is looped forever
{
  if (updateSensorData)  //Keep the updating of data as a separate task
  {
    mySensor.updateAccel();        //Update the Accelerometer data
    mySensor.updateLinearAccel();  //Update the Linear Acceleration data
    mySensor.updateGravAccel();    //Update the Gravity Acceleration data
    mySensor.updateCalibStatus();  //Update the Calibration Status
    updateSensorData = false;
  }
  if ((millis() - lastStreamTime) >= streamPeriod)
  {
    lastStreamTime = millis();

    Serial.print("Time: ");
    Serial.print(lastStreamTime);
    Serial.print("ms ");

    Serial.print("      aX: ");
    Serial.print(mySensor.readAccelX()); //Accelerometer X-Axis data
    Serial.print("m/s2 ");

    Serial.print(" aY: ");
    Serial.print(mySensor.readAccelY());  //Accelerometer Y-Axis data
    Serial.print("m/s2 ");

    Serial.print(" aZ: ");
    Serial.print(mySensor.readAccelZ());  //Accelerometer Z-Axis data
    Serial.print("m/s2 ");

    Serial.print("      lX: ");
    Serial.print(mySensor.readLinearAccelX()); //Linear Acceleration X-Axis data
    Serial.print("m/s2 ");

    Serial.print(" lY: ");
    Serial.print(mySensor.readLinearAccelY());  //Linear Acceleration Y-Axis data
    Serial.print("m/s2 ");

    Serial.print(" lZ: ");
    Serial.print(mySensor.readLinearAccelZ());  //Linear Acceleration Z-Axis data
    Serial.print("m/s2 ");

    Serial.print("      gX: ");
    Serial.print(mySensor.readGravAccelX()); //Gravity Acceleration X-Axis data
    Serial.print("m/s2 ");

    Serial.print(" gY: ");
    Serial.print(mySensor.readGravAccelY());  //Gravity Acceleration Y-Axis data
    Serial.print("m/s2 ");

    Serial.print(" gZ: ");
    Serial.print(mySensor.readGravAccelZ());  //Gravity Acceleration Z-Axis data
    Serial.print("m/s2 ");

    Serial.print("      C: ");
    Serial.print(mySensor.readAccelCalibStatus());  //Accelerometer Calibration Status (0 - 3)

    Serial.println();

    updateSensorData = true;
  }
}

产品相关推荐

Erweima.png

产品购买地址

Arduino 9 Axes Motion Shield 9轴运动扩展板

周边产品推荐

9轴姿态传感器 LSM9DS0 三轴加速度计 陀螺仪 磁力计
Block for Intel Edison 9轴姿态传感器

相关问题解答

相关学习资料

Arduino 9 Axes Motion Shield 官方相关资料
Arduino 9 Axes Motion Shield原理图
Arduino 9 Axes Motion Shield原理图 EAGLE文件下载
奥松机器人技术论坛