一、相关API

1、begin:需要在其他CUIREIMU前调用

//*********************************************************************************************
//函数名称:CurieImu.begin()
//输入参数:无
//函数返回:无
//函数功能:开六轴传感器,必须第一个调用
//*********************************************************************************************
CurieIMU.begin();

2、得到陀螺仪的采样频率

//*********************************************************************************************
//函数名称:CurieImu.getGyroRate()
//输入参数:无
//函数返回:25 50 100 200 400 800 1600 3200(Hz)
//函数功能:得到陀螺仪的采样频率
//*********************************************************************************************
CurieIMU.getGyroRate();

3、设置陀螺仪的采样频率

他的数据速率也是采样频率,并影响读数的带宽。

//*********************************************************************************************
//函数名称:CurieImu.setGyroRate(int rate)
//输入参数:rate 采样频率 25 50 100 200 400 800 1600 3200(Hz)
//函数返回:无
//函数功能:无
//*********************************************************************************************
CurieImu.setGyroRate(int rate);

4、得到加速度计的采样频率

//*********************************************************************************************
//函数名称:CurieImu.getAccelerometerRate()
//输入参数:无
//函数返回:rate 采样频率 12.5 25 50 100 200 400 800 1600 
//函数功能:返回加速度计的采样频率
//*********************************************************************************************
CurieIMU.getAccelerometerRate()

5、设置加速度计的采样频率

//*********************************************************************************************
//函数名称:CurieImu.setAccelerometerRate(float rate)
//输入参数:rate 采样频率 12.5 25 50 100 200 400 800 1600
//函数返回:无
//函数功能:返回加速度计的采样频率
//*********************************************************************************************
CurieIMU.setAccelerometerRate(float rate)

6、返回陀螺仪测量范围

//*********************************************************************************************
//函数名称:CurieImu.getGyroRange()
//输入参数:无
//函数返回:2000 (+/-2000°/s)
// 1000 (+/-1000°/s)
// 500 (+/-500°/s)
// 250 (+/-250°/s)
// 125 (+/-125°/s)
//函数功能:返回陀螺仪的测量范围
//*********************************************************************************************
CurieIMU.getGyroRange()

7、设置陀螺仪测量范围

//*********************************************************************************************
//函数名称:CurieImu.setGyroRange()
//输入参数:2000 (+/-2000°/s)
// 1000 (+/-1000°/s)
// 500 (+/-500°/s)
// 250 (+/-250°/s)
// 125 (+/-125°/s)
//函数返回:无
//函数功能:返回陀螺仪的测量范围
//*********************************************************************************************
CurieIMU.setGyroRange()

8、得到加速度计的测量范围

//*********************************************************************************************
//函数名称:CurieImu.getAccelerometerRange()
//输入参数:无
//函数返回:2 (+/- 2g)
// 4 (+/- 4g)
// 8 (+/- 8g)
// 16 (+/- 16g)
//函数功能:返回陀螺仪的测量范围
//*********************************************************************************************
CurieIMU.getAccelerometerRange()

9、设置加速度计的测量范围

//*********************************************************************************************
//函数名称:CurieImu.setAccelerometerRange(int range)
//输入参数:2 (+/- 2g)
// 4 (+/- 4g)
// 8 (+/- 8g)
// 16 (+/- 16g)
//函数返回:无
//函数功能:返回陀螺仪的测量范围
//*********************************************************************************************
CurieIMU.setAccelerometerRange(int range)

10、自动进行陀螺仪偏移计算

//*********************************************************************************************
//函数名称:CurieImu.autoCalibrateGyroOffset()
//输入参数:无
//函数返回:无
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.autoCalibrateGyroOffset()

11、自动进行加速计偏移计算

//*********************************************************************************************
//函数名称:CurieImu.autoCalibrateAccelerometerOffset(int, axis, int target)
//输入参数:axis: X_AXIS
// Y_AXIS
// Z_AXIS
// target: it can be 0 or 1. 1表示要取消重力的影响,即平躺时Z轴应该写1
//函数返回:无
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.autoCalibrateAccelerometerOffset(int, axis, int target)

12、偏移修正开关

//关闭
CurieIMU.noGyroOffset();
CurieIMU.noAccelerometerOffset(); //打开
CurieIMU.gyroOffsetEnabled();
CurieIMU.accelerometerOffsetEnabled();

13、得到陀螺仪偏移修正的数值

//*********************************************************************************************
//函数名称:CurieImu.getGyroOffset(int axis)
//输入参数:axis: X_AXIS
// Y_AXIS
// Z_AXIS
//函数返回:修正的偏移值,The returned value is from -31.25 °/s to +31.25 °/s in discrete steps of 0.061 °/s.
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.getGyroOffset(int axis)

14、设置陀螺仪偏移

//*********************************************************************************************
//函数名称:CurieImu.setGyroOffset(int axis, int offset)
//输入参数:axis: X_AXIS
// Y_AXIS
// Z_AXIS
// offset 偏移
//函数返回:
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.setGyroOffset(int axis, int offset)

15、得到陀螺仪偏移

//*********************************************************************************************
//函数名称:CurieImu.getAccelerometerOffset(int axis)
//输入参数:axis: X_AXIS
// Y_AXIS
// Z_AXIS
//函数返回:
//函数功能:
//*********************************************************************************************
CurieIMU.getAccelerometerOffset(int axis)

16、设置陀螺仪偏移

//*********************************************************************************************
//函数名称:CurieImu.setAccelerometerOffset(int axis, int offset)
//输入参数:axis: X_AXIS
// Y_AXIS
// Z_AXIS
// offset 偏移
//函数返回:
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.setAccelerometerOffset(int axis, int offset)

17、得到检测阈值

//*********************************************************************************************
//函数名称:CurieImu.getDetectionThreshold(int feature)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_TAP
//函数返回:
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.getDetectionThreshold(int feature)

18、设置检测阈值

//*********************************************************************************************
//函数名称:CurieImu.setDetectionThreshold(int feature, float value)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_TAP
//函数返回:
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.setDetectionThreshold(int feature, float value)

19、得到检测的持续时间

//*********************************************************************************************
//函数名称:CurieImu.getDetectionDuration(int feature)
//输入参数:feature: the requested feature. It can assume one of these values:
  • CURIE_IMU_TAP

  • CURIE_IMU_TAP_QUIET
  • CURIE_IMU_DOUBLE_TAP
  • CURIE_IMU_ZERO_MOTION
//函数返回:
//函数功能:检测持续时间
//*********************************************************************************************
CurieIMU.getDetectionDuration(int feature)

20、设置检测的持续时间

//*********************************************************************************************
//函数名称:CurieImu.setDetectionDuration(int feature, float value)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_DOUBLE_TAP
// CURIE_IMU_TAP_SHOCK
// CURIE_IMU_TAP_QUIET P
//函数返回:
//函数功能:检测持续时间
//*********************************************************************************************
CurieIMU.setDetectionDuration(int feature, float value)

21、允许某个特征产生中断

//*********************************************************************************************
//函数名称:CurieImu.interrupts(int feature)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_STEP
// CURIE_IMU_TAP
// CURIE_IMU_TAP_SHOCK
// CURIE_IMU_TAP_QUIET
// CURIE_IMU_DOUBLE_TAP
//函数返回:
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.interrupts(int feature)

22、关闭某个特征产生中断

//*********************************************************************************************
//函数名称:CurieImu.noInterrupts(int feature)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_STEP
// CURIE_IMU_TAP
// CURIE_IMU_TAP_SHOCK
// CURIE_IMU_TAP_QUIET
// CURIE_IMU_DOUBLE_TAP
//函数返回:
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.noInterrupts(int feature)

23、返回某个特征是否开了中断

//*********************************************************************************************
//函数名称:CurieImu.interruptEnabled(int feature)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_STEP
// CURIE_IMU_TAP
// CURIE_IMU_TAP_SHOCK
// CURIE_IMU_TAP_QUIET
// CURIE_IMU_DOUBLE_TAP
//函数返回:TURE FALSE
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.interruptEnabled(int feature)

24、检测是否进入中断状态

//*********************************************************************************************
//函数名称:CurieImu.getInterruptStatus(int feature)
//输入参数:feature: the requested feature. It can assume one of these values:
// CURIE_IMU_FREEFALL
// CURIE_IMU_SHOCK
// CURIE_IMU_MOTION
// CURIE_IMU_ZERO_MOTION
// CURIE_IMU_STEP
// CURIE_IMU_TAP
// CURIE_IMU_TAP_SHOCK
// CURIE_IMU_TAP_QUIET
// CURIE_IMU_DOUBLE_TAP
//函数返回:TURE FALSE
//函数功能:进行陀螺仪偏移计算
//*********************************************************************************************
CurieIMU.getInterruptStatus(int feature)

25、返回步进检测模式的值

//*********************************************************************************************
//函数名称:CurieImu.getStepDetectionMode()
//输入参数:CURIE_IMU_STEP_MODE_NORMAL
// CURIE_IMU_STEP_MODE_SENSITIVE
// CURIE_IMU_STEP_MODE_ROBUST
// CURIE_IMU_STEP_MODE_UNKNOWN
//函数返回:TURE FALSE
//*********************************************************************************************
CurieIMU.getStepDetectionMode()

26、设置步进检测模式的值

//*********************************************************************************************
//函数名称:CurieImu.setStepDetectionMode(int mode)
//输入参数:CURIE_IMU_STEP_MODE_NORMAL
// CURIE_IMU_STEP_MODE_SENSITIVE
// CURIE_IMU_STEP_MODE_ROBUST
// CURIE_IMU_STEP_MODE_UNKNOWN
//函数返回:TURE FALSE
//*********************************************************************************************
CurieIMU.setStepDetectionMode(in mode)

27、读取6轴传感器的数值

//*********************************************************************************************
//函数名称:CurieImu.readMotionSensor(int ax, int ay, int az, int gx, int gy, int gz)
//输入参数:ax: a variable in which the accelerometer's value along x will be stored.
// ay: a variable in which the accelerometer's value along y will be stored.
// az: a variable in which the accelerometer's value along z will be stored.
// gx: a variable in which the gyro's value along x will be stored.
// gy: a variable in which the gyro's value along y will be stored.
// gz: a variable in which the gyro's value along z will be stored.
//函数返回:
//*********************************************************************************************
CurieIMU.readMotionSensor(int ax, int ay, int az, int gx, int gy, int gz)

28、读取加速度的数值

//*********************************************************************************************
//函数名称:CurieImu.readAccelerometer(int ax, int ay, int az)
//输入参数:ax: a variable in which the accelerometer's value along x will be stored.
// ay: a variable in which the accelerometer's value along y will be stored.
// az: a variable in which the accelerometer's value along z will be stored.
//函数返回:
//*********************************************************************************************
CurieIMU.readAccelerometer(int ax, int ay, int az)

29、读取陀螺仪的数值

//*********************************************************************************************
//函数名称:CurieImu.readGyro(int gx, int gy, int gz)
//输入参数:
// gx: a variable in which the gyro's value along x will be stored.
// gy: a variable in which the gyro's value along y will be stored.
// gz: a variable in which the gyro's value along z will be stored.
//函数返回:
//*********************************************************************************************
CurieIMU.readGyro(int gx, int gy, int gz)

30、读取温度值

//*********************************************************************************************
//函数名称:CurieImu.readTemperature()
//输入参数:
//函数返回:Celsius=(raw/32767.0)+23 16位的
//*********************************************************************************************
CurieIMU.readTemperature()

31、检测晃动

//*********************************************************************************************
//函数名称:CurieIMU.shockDetected(int axis, int direction)
//输入参数:axis: the axis to check for shock detection. It must have one of these values:
// X_AXIS
// Y_AXIS
// Z_AXIS
// direction: the direction to check for shock detection. It must have one of these values:
// POSITIVE from zero to positive axis values
// NEGATIVE from zero to negative axis values
//函数返回:Ture False
//*********************************************************************************************
CurieIMU.shockDetected(int axis, int direction)

32、检测动作

//*********************************************************************************************
//函数名称:CurieImu.motionDetected(int axis, int direction)
//输入参数:axis: the axis to check for shock detection. It must have one of these values:
// X_AXIS
// Y_AXIS
// Z_AXIS
// direction: the direction to check for shock detection. It must have one of these values:
// POSITIVE from zero to positive axis values
// NEGATIVE from zero to negative axis values
//函数返回:Ture False
//*********************************************************************************************
CurieIMU.motionDetected(int axis, int direction)

33、其他检测

CurieIMU.tapDetected(int axis, int direction)

CurieIMU.stepsDetected()

34、注册中断函数

//*********************************************************************************************
//函数名称:CurieIMU.attachInterrupt(voidFuncPtr callback)
//输入参数:注册中断函数
//函数返回:无
//*********************************************************************************************
CurieIMU.attachInterrupt(voidFuncPtr callback)

35、取消注册中断函数

CurieIMU.detachInterrupt()

二、

Arduino101学习笔记(十三)—— 101六轴传感器的更多相关文章

  1. 20145213《Java程序设计学习笔记》第六周学习总结

    20145213<Java程序设计学习笔记>第六周学习总结 说在前面的话 上篇博客中娄老师指出我因为数据结构基础薄弱,才导致对第九章内容浅尝遏止地认知.在这里我还要自我批评一下,其实我事后 ...

  2. python3.4学习笔记(十三) 网络爬虫实例代码,使用pyspider抓取多牛投资吧里面的文章信息,抓取政府网新闻内容

    python3.4学习笔记(十三) 网络爬虫实例代码,使用pyspider抓取多牛投资吧里面的文章信息PySpider:一个国人编写的强大的网络爬虫系统并带有强大的WebUI,采用Python语言编写 ...

  3. 【Unity Shaders】学习笔记——SurfaceShader(六)混合纹理

    [Unity Shaders]学习笔记——SurfaceShader(六)混合纹理 转载请注明出处:http://www.cnblogs.com/-867259206/p/5619810.html 写 ...

  4. java之jvm学习笔记十三(jvm基本结构)

    java之jvm学习笔记十三(jvm基本结构) 这一节,主要来学习jvm的基本结构,也就是概述.说是概述,内容很多,而且概念量也很大,不过关于概念方面,你不用担心,我完全有信心,让概念在你的脑子里变成 ...

  5. Nodejs学习笔记(十六)--- Pomelo介绍&入门

    目录 前言&介绍 安装Pomelo 创建项目并启动 创建项目 项目结构说明 启动 测试连接 聊天服务器 新建gate和chat服务器 配置master.json 配置servers.json ...

  6. python3.4学习笔记(二十六) Python 输出json到文件,让json.dumps输出中文 实例代码

    python3.4学习笔记(二十六) Python 输出json到文件,让json.dumps输出中文 实例代码 python的json.dumps方法默认会输出成这种格式"\u535a\u ...

  7. Go语言学习笔记十三: Map集合

    Go语言学习笔记十三: Map集合 Map在每种语言中基本都有,Java中是属于集合类Map,其包括HashMap, TreeMap等.而Python语言直接就属于一种类型,写法上比Java还简单. ...

  8. Nodejs学习笔记(十六)—Pomelo介绍&入门

    前言&介绍 Pomelo:一个快速.可扩展.Node.js分布式游戏服务器框架 从三四年前接触Node.js开始就接触到了Pomelo,从Pomelo最初的版本到现在,总的来说网易出品还算不错 ...

  9. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第六章:在Direct3D中绘制

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第六章:在Direct3D中绘制 代码工程地址: https://gi ...

随机推荐

  1. json和对象、list互转

    1.把对象,list转成json: import com.alibaba.fastjson.JSONObject; Object obj = new Object(); // ... String o ...

  2. 查看Android应用包名package和入口activity名称

    使用android自动化测试工具启动应用时,需要填写被测程序的包名和启动的Activity,以下有两种查看应用包名package和入口activity名称的方法: 方法一:使用aapt    //aa ...

  3. Apache2.4.6 添加虚拟主机

    apache2.4 与 apache2.2 的虚拟主机配置写法有所不同 apache2.2的写法: <VirtualHost *:80> ServerName domain.com Doc ...

  4. javascript 数组去重

    2015年5月15日 20:17:05 星期五 原理: .......(说不清楚, 自己看代码吧, 很简单.....) //去重 var hash_already_input = {}; for (v ...

  5. 常见kill信号

    字符名 数字名 组合键ctrl+ 备注 SIGTERM 15   kill的默认值,可以杀死后台进程 SIGKILL 9   不可忽略,必杀技 SIGTSTP 20 Z 前台组全暂停(只是组合键方式吧 ...

  6. hdu 1014.Uniform Generator 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1014 题目意思:给出 STEP 和 MOD,然后根据这个公式:seed(x+1) = [seed(x) ...

  7. springmvc 文件下传、上载、预览。以二进制形式存放到数据库(转载)

    springmvc 文件上传.下载.预览.以二进制形式存放到数据库.数据库中的关于传入附件的字段我写了2个:一个存放内容accessory,一个存放文件的后缀filetype 上传:首先需要2个必须的 ...

  8. qt编译mysql插件

    安装MySQL,C:\Program Files (x86)\MySQL\MySQL Server 5.7,然后把include和lib文件夹拷贝到C盘,因为qmake不允许路径中有空格!!! 安装Q ...

  9. osgconv 将多个模型合成一个模型

    osgconv a.osg b.osg c.osg BigOne.ive 以上命令的作用是将a.osg.b.osg.c.osg三个模型合并到BigOne.ive模型

  10. js中我的注释规范

    模块功能描述说明: /** * ------------------------------------------------------------------ * 模块描述说明 * ------ ...