Emakefun Gesture Recognizer 2.0
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | 静态 Public 属性 | 所有成员列表
emakefun::GestureRecognizer类 参考

手势识别传感器 更多...

#include <gesture_recognizer.h>

Public 类型

enum  ErrorCode : uint32_t {
  kOK = 0 , kI2cDataTooLongToFitInTransmitBuffer = 1 , kI2cReceivedNackOnTransmitOfAddress = 2 , kI2cReceivedNackOnTransmitOfData = 3 ,
  kI2cOtherError = 4 , kI2cTimeout = 5 , kInvalidParameter = 6 , kUnknownError = 7
}
 错误码 更多...
 
enum  Gesture : uint8_t {
  kGestureNone = 0x0 , kGestureRightSwipe = 0x01 , kGestureLeftSwipe = 0x02 , kGestureBackwardSwipe = 0x03 ,
  kGestureForwardSwipe = 0x04 , kGestureUpward = 0x05 , kGestureDownward = 0x06 , kGestureExited = 0x07 ,
  kGestureHover = 0x08
}
 手势类型 更多...
 

Public 成员函数

 GestureRecognizer (TwoWire &wire=Wire, const uint8_t i2c_address=kDefaultI2cAddress)
 构造函数
 
ErrorCode Initialize ()
 
Gesture GetGesture ()
 获取识别到的手势
 

静态 Public 属性

static constexpr uint8_t kDefaultI2cAddress = 0x39
 手势识别传感器默认I2C地址
 

详细描述

手势识别传感器

示例
get_gesture.ino.

成员枚举类型说明

◆ ErrorCode

错误码

枚举值
kOK 

0:成功

kI2cDataTooLongToFitInTransmitBuffer 

1:I2C数据太长,无法装入传输缓冲区

kI2cReceivedNackOnTransmitOfAddress 

2:在I2C发送地址时收到NACK

kI2cReceivedNackOnTransmitOfData 

3:在I2C发送数据时收到NACK

kI2cOtherError 

4:其他I2C错误

kI2cTimeout 

5:I2C通讯超时

kInvalidParameter 

6:参数错误

kUnknownError 

7: 未知错误

◆ Gesture

手势类型

枚举值
kGestureNone 

0x00: 无手势动作

kGestureRightSwipe 

0x01: 右移动作

kGestureLeftSwipe 

0x02: 左移动作

kGestureBackwardSwipe 

0x03: 后移动作

kGestureForwardSwipe 

0x04: 前移动作

kGestureUpward 

0x05: 上拉动作

kGestureDownward 

0x06: 下压动作

kGestureExited 

0x07: 离开感应区

kGestureHover 

0x08: 悬停

构造及析构函数说明

◆ GestureRecognizer()

emakefun::GestureRecognizer::GestureRecognizer ( TwoWire &  wire = Wire,
const uint8_t  i2c_address = kDefaultI2cAddress 
)
explicit

构造函数

参数
[in]wireTwoWire对象,默认为Arduino Wire
[in]i2c_address手势识别传感器I2C地址,默认值为0x39

成员函数说明

◆ GetGesture()

GestureRecognizer::Gesture emakefun::GestureRecognizer::GetGesture ( )

获取识别到的手势

返回
手势类型,参考枚举: GestureRecognizer::Gesture

类成员变量说明

◆ kDefaultI2cAddress

constexpr uint8_t emakefun::GestureRecognizer::kDefaultI2cAddress = 0x39
staticconstexpr

手势识别传感器默认I2C地址

0x39: 默认I2C地址


该类的文档由以下文件生成: