国外设计网站素材,做电子商务网站需要什么手续,网站开发课程软件,考研比较厉害的培训机构学物联网#xff0c;来万物简单IoT物联网#xff01;#xff01; 一、产品简介
手势识别传感器PAJ7620u2是一款集成3D手势识别和运动跟踪为一体的交互式传感器#xff0c;传感器可以在有效范围内识别手指的顺时针/逆时针转动方向和手指的运动方向等。它可以识别13种手势来万物简单IoT物联网 一、产品简介
手势识别传感器PAJ7620u2是一款集成3D手势识别和运动跟踪为一体的交互式传感器传感器可以在有效范围内识别手指的顺时针/逆时针转动方向和手指的运动方向等。它可以识别13种手势包括向上移动向下移动向左移动向右移动向前移动向后移动顺时针方向从左到右从左到右等等手势姿态。 传感器可以应用于各类互动的场景可以挥一挥手定义你想完成的任何动作比如挥一挥手可以关灯。 引脚定义:
VCC3.3VGND地SCLI2C时钟SDAI2C数据INT中断引脚
二、技术参数
工作电压3.3V-5V通讯方式I2C接口手势识别支持9种手势姿态工作温度-40°C~85°C支持环境光100K Lux工作电流3mA-10mA电路板尺寸20mm * 15mm
三、软件接口
PAJ7620(i2cObj) - 创建PAJ7620传感器对象
函数原型 paj7620Obj PAJ7620(i2cObj) 参数说明
参数类型必选参数说明i2cObjI2C是传入I2C对象
返回值 PAJ7620对象成功返回PAJ7620对象PAJ7620对象创建失败抛出Exception 示例代码
from machine import Pin,I2C
import paj7620i2cObj I2C(1, sclPin(22), sdaPin(21), freq400000)
paj7620Obj paj7620.PAJ7620(i2cobj)
print(start init paj7620)输出
start init paj7620setGestureHighrate(rate:bool) - 设置手势识别的速率
函数功能 设置RTC时钟信息 函数原型 PAJ7620.setDatetime(data) 参数说明 rateTrue-高速False-慢速 返回值 无 getGesture() - 获取检测到的姿势状态值
函数功能 获取检测到的姿势状态值 函数原型 gesture PAJ7620.getGesture() 参数说明 无 返回值 成功返回gesture的手势姿态值 gesture说明0未检测姿态1向右2向左4向上8向下16向前32向后64顺时针128逆时针256摇摆
gestureDescription(gesture) - 获取手势姿势的描述信息
函数功能 获取手势姿势的描述信息 函数原型 description PAJ7620.gestureDescription(gesture) 参数说明 手势姿态状态值 返回值 成功返回gesture的手势姿态描述 gesturedescription说明0None未检测姿态1Right向右2Left向左4Up向上8Down向下16Forward向前32Backward向后64Clockwise顺时针128Anti-Clockwise逆时针256Wave摇摆
示例
from machine import Pin,I2C
import paj7620i2cObj I2C(1, sclPin(22), sdaPin(21), freq400000)
paj7620Obj paj7620.PAJ7620(i2cobj)
print(start init paj7620)
paj7620Obj.setGestureHighrate(True)
gesture paj7620Obj.getGesture()
description paj7620_obj.gestureDescription(gesture)
print(gesture code %d%(gesture))
print(gesture description description)输出
start init paj7620
gesture code 2
gesture description Left四、接口案例
案例代码
from machine import Pin,I2C
import paj7620
import utimepaj7620_obj Nonedef paj7620_init():global paj7620Obji2cObj I2C(1, sclPin(22), sdaPin(21), freq400000)paj7620Obj paj7620.PAJ7620(i2cobj)print(start init paj7620)paj7620Obj.setGestureHighrate(True)if __name__ __main__:paj7620_init()while True:gesture paj7620Obj.getGesture()if gesture ! paj7620Obj.GESTURE_NONE:description paj7620Obj.gestureDescription(gesture)print(--------------Gesture Recognition System---------------------------)print(gesture code %d%(gesture))print(gesture description description)输出
start init paj7620
--------------Gesture Recognition System---------------------------
gesture code 1
gesture description Right
--------------Gesture Recognition System---------------------------
gesture code 4
gesture description Up
--------------Gesture Recognition System---------------------------
gesture code 8
gesture description Down
--------------Gesture Recognition System---------------------------
gesture code 1
gesture description Right
--------------Gesture Recognition System---------------------------
gesture code 2
gesture description Left
--------------Gesture Recognition System---------------------------
gesture code 2
gesture description Left参考文献及购买链接
[1] PAJ7620手势识别传感器购买链接