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

來自ALSROBOT WiKi
跳轉(zhuǎn)至: 導(dǎo)航搜索
RB01C10401.png

目錄

產(chǎn)品概述

Arduino 9軸運(yùn)動(dòng)擴(kuò)展板基于德國博世傳感器技術(shù)有限公司推出的BNO055絕對(duì)方向傳感器。 BNO055為系統(tǒng)級(jí)封裝(SiP),集成三軸14位加速計(jì)、三軸16位陀螺儀(每秒±2000度)、三軸地磁傳感器和運(yùn)行BSX3.0 FusionLib 軟件的32位微控制器。BNO055有三維加速度、角速度和磁場強(qiáng)度數(shù)據(jù),各自在三個(gè)垂直的軸上。 另外,它還提供傳感器融合信號(hào),如 四元數(shù)、歐拉角、旋轉(zhuǎn)矢量、線性加速、重力矢量,此外,它還結(jié)合智能中斷引擎,可以基于下述各項(xiàng)觸發(fā)中斷,慢動(dòng)作或誤動(dòng)作識(shí)別,任何動(dòng)作(斜率)檢測(cè),高g檢測(cè)。Arduino 9軸運(yùn)動(dòng)擴(kuò)展板兼容TinkerKit,這意味著你可以通過將TinkerKit模塊插入到電路板上快速創(chuàng)建項(xiàng)目。

規(guī)格參數(shù)

  1. 工作電壓:5V
  2. 功耗:50mW
  3. 供電:Arduino 9軸運(yùn)動(dòng)擴(kuò)展板無電源插孔,只有在連接到電路板時(shí)才能加電。
  4. TinkerKit 接口:輸入2個(gè)、輸出2個(gè)、TWI 2個(gè)
  5. 外形尺寸:長*寬為2.7*2.1英寸

接口介紹

輸入和輸出

Arduino 9軸運(yùn)動(dòng)擴(kuò)展板有數(shù)個(gè)TinkerKit輸入/輸出和通信接口。連接TinkerKit模塊可以簡化項(xiàng)目或原型的創(chuàng)建工作。
板載接口有:

  • 2 個(gè)TinkerKit 輸入接口: IN2和IN3(白色),這些接口路由到Arduino A2和A3模擬輸入引腳。
  • 2 個(gè)TinkerKit 輸出接口: OUT5和OUT6(橙色),這些接口路由到引腳5和6上的Arduino PWM輸出端口。
  • 2 個(gè)TinkerKit TWI: 這些接口(4引腳,白色)在Arduino TWI接口上進(jìn)行路由。兩個(gè)都連接到相同的TWI接口,讓你可以創(chuàng)建一連串的TWI設(shè)備。

兼容性

Arduino 9軸運(yùn)動(dòng)擴(kuò)展板兼容Uno、Yùn、Leonardo、Ethernet、Mega和Due電路板。在使用Arduino 9軸運(yùn)動(dòng)擴(kuò)展板時(shí),一定要根據(jù)使用的電路板將中斷橋和重置橋焊接在正確位置。見下表:

RB01C10402.png

例子程序

以下為傳送加速度計(jì)數(shù)據(jù)的示例代碼

#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;
  }
}

產(chǎn)品相關(guān)推薦

Erweima.png

產(chǎn)品購買地址

Arduino 9 Axes Motion Shield 9軸運(yùn)動(dòng)擴(kuò)展板

周邊產(chǎn)品推薦

9軸姿態(tài)傳感器 LSM9DS0 三軸加速度計(jì) 陀螺儀 磁力計(jì)
Block for Intel Edison 9軸姿態(tài)傳感器

相關(guān)問題解答

相關(guān)學(xué)習(xí)資料

Arduino 9 Axes Motion Shield 官方相關(guān)資料
Arduino 9 Axes Motion Shield原理圖
Arduino 9 Axes Motion Shield原理圖 EAGLE文件下載
奧松機(jī)器人技術(shù)論壇