一:PAJ7620手势模块
是一款基于的手势识别模块,可直接识别9种基本手势,PAJ7620U2 Gesture SensorPAJ7620U2支持I2c接口,兼容 3.3V/5V 电平。
相比 APDs-9960 等方案,我识别速度更快,准确度更高,可识别手势更多,且抗干扰性更强,适用于智家居、机器人交互等%功耗应用场景。
二:产品特点:
基于PAJ7620U2传感器,
可直接识别9种基本手势,
支持手势中断输出内置红外LED和光学镜头,能在低光和黑暗环境下工作
支持I2C接口通信,仅需两根信号脚即可控制板载电平转换电路,
可兼容3.3V/5V的逻辑电平
提供完善的配套资料手册(Raspberry/Arduino/STM32示例程序和用户手册等)
三:具体参数
工作电压:3.3V/5V
通信接口:IIC
识别距离:5CM~15CM
识别手势:上、下、左、右、前、后、顺时针、逆时针、摇摆
识别速度:240HZ
识别视角:60°(对角线)
环境光免疫力:〈100KLUX
产品尺寸:20MMX20MM
过孔直径:2.OMM
四:软件代码:4.1 初始化模块
void setup()
{
Serial.begin(115200);
delay(300);
//切换IIC的引脚地址
Wire.begin(2, 1);
Serial.println("Gesture recognition system base on PAJ7620U2");
while(paj.begin() != 0){
Serial.println("initial PAJ7620U2 failure! Please check if all the connections are fine, or if the wire sequence is correct?");
delay(500);
}
Serial.println("PAJ7620U2init completed, start to test the gesture recognition function");
paj.setGestureHighRate(false);
}这里使用的官方的库函数,同时需要切换一下IIC的引脚就可以了。
4.2 主程序代码:
DFRobot_PAJ7620U2::eGesture_t gesture = paj.getGesture();
if(gesture != paj.eGestureNone ){
/* Get the string descritpion corresponding to the gesture number
* The string description could be
* "None","Right","Left", "Up", "Down", "Forward", "Backward", "Clockwise", "Anti-Clockwise", "Wave",
* "WaveSlowlyDisorder", "WaveSlowlyLeftRight", "WaveSlowlyUpDown", "WaveSlowlyForwardBackward"
*/
String description = paj.gestureDescription(gesture);
Serial.println("--------------Gesture Recognition System---------------------------");
Serial.print("gesture code = ");Serial.println(gesture);
Serial.print("gesture description = ");Serial.println(description);
Serial.println();
}五:实验验证:
实物图片:

串口检测数据如下所示:

我要赚赏金
