“Sensor-Gen&RGB/zh”的版本间的差异
(创建页面,内容为“{| style="width: 800px;" |- |300px|left || ::<p style="color: #000000;font-size:200%"><br><br><br><br><br>'''Sensor-Gen&RGB'''</p> :…”) |
|||
(未显示同一用户的13个中间版本) | |||
第1行: | 第1行: | ||
{| style="width: 800px;" | {| style="width: 800px;" | ||
|- | |- | ||
− | |[[File: Microduino- | + | |[[File: Microduino-Ges&RGB.jpg|300px|left]] || |
− | ::<p style="color: #000000;font-size:200%"><br><br><br><br><br>'''Sensor- | + | ::<p style="color: #000000;font-size:200%"><br><br><br><br><br>'''Sensor-Ges&RGB'''</p> |
− | ::产品编号:'''<big style="color: #00A0A6"> | + | ::产品编号:'''<big style="color: #00A0A6"> </big>''' |
|- | |- | ||
|[[File: Add-to-cart.jpg|300px|left|link=https://shop108263663.taobao.com/?spm=a230r.7195193.1997079397.2.ek3cAW]]|| | |[[File: Add-to-cart.jpg|300px|left|link=https://shop108263663.taobao.com/?spm=a230r.7195193.1997079397.2.ek3cAW]]|| | ||
− | ::<p style="color: #000000;font-size:120%">Sensor- | + | ::<p style="color: #000000;font-size:120%">Sensor-Ges&RGB是手势颜色传感器模块,可用于手势和颜色的识别。识别上、下、左、右、远、近等手势以及识别出不同颜色的RGB值 |
+ | </p> | ||
|} | |} | ||
+ | <br> | ||
+ | <br> | ||
+ | {| style="width: 800px;" | ||
+ | |- | ||
+ | | | ||
+ | <p style="color: #333333;font-size:155%">'''技术规格'''</p> | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | | '''电压'''||3.3V~5V | ||
+ | |- | ||
+ | | '''传感器大小'''||23.5mm*13mm | ||
+ | |- | ||
+ | | '''接口'''||1.27mm间距的4Pin座 | ||
+ | |- | ||
+ | | '''通信协议'''||I2C(地址0x39) | ||
+ | |- | ||
+ | | '''传感器型号'''||APDS9960 | ||
+ | |} | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''引脚'''</p> | ||
+ | {| border="0" cellpadding="10" width="90%" | ||
+ | |- | ||
+ | |width="35%" valign="center" align="left"| | ||
+ | *IN'''<big style="color: #00A0A6">(I2C通信)</big>''' | ||
+ | **PIN1:GND | ||
+ | **PIN2:VCC | ||
+ | **PIN3:SDA | ||
+ | **PIN4:SCL | ||
+ | |width="35%" valign="top" align="center"| | ||
+ | [[file: Sensor_backpin.png|130px|center]] | ||
+ | |width="25%" valign="top" align="center"| | ||
+ | |} | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''编程手册'''</p> | ||
+ | '''手势识别''' | ||
+ | *您可以通过[[AVR核心:Getting_started/zh|Getting Started]]了解使用Arduino IDE编程控制模块。 | ||
+ | *本传感器可连接到核心的以下接口:'''I2C''' | ||
+ | *除核心、电池盒、SensorHub外,还需准备一个Sensor-Ges&RGB传感器 | ||
+ | *本传感器识别上、下、左、右、远、近的手势 | ||
+ | *使用4pin传感器线连接传感器与SensorHub扩展板的IIC接口[[File:Sensor-Ges&RGB2.JPG|thumb|center|400px]] | ||
+ | *该例程效果为:下载程序后,保持USB线连接,打开串口(波特率设置为9600),观察返回值。 | ||
+ | **分别向上、下、左、右、远、近挥手,测试是否识别到相应手势 | ||
+ | **标准动作:(以向左挥手为例)从sensor右边,水平匀速挥手到sensor左边 | ||
+ | **推荐距离:手与sensor垂直距离10cm内为最佳 | ||
+ | **当'''向右挥手''',观察串口返回值为'''RIGHT''' | ||
+ | **注:动作是否标准会影响识别的准确度,使用最佳距离在10cm以内 | ||
+ | |||
+ | <source lang="cpp"> | ||
+ | #include <Microduino_Gesture.h> | ||
+ | // Global Variables | ||
+ | Gesture gestureSensor; | ||
+ | void setup() { | ||
+ | // put your setup code here, to run once: | ||
+ | Serial.begin(9600); | ||
+ | // Initialize Gesture (configure I2C and initial values) | ||
+ | gestureSensor.begin() ; | ||
+ | // Start running the Gesture gesture sensor engine | ||
+ | gestureSensor.enableGestureSensor(true); | ||
+ | } | ||
+ | void loop() { | ||
+ | if ( gestureSensor.isGestureAvailable() ) { | ||
+ | switch ( gestureSensor.readGesture() ) { | ||
+ | case DIR_UP: | ||
+ | Serial.println("UP"); | ||
+ | break; | ||
+ | case DIR_DOWN: | ||
+ | Serial.println("DOWN"); | ||
+ | break; | ||
+ | case DIR_LEFT: | ||
+ | Serial.println("LEFT"); | ||
+ | break; | ||
+ | case DIR_RIGHT: | ||
+ | Serial.println("RIGHT"); | ||
+ | break; | ||
+ | case DIR_NEAR: | ||
+ | Serial.println("NEAR"); | ||
+ | break; | ||
+ | case DIR_FAR: | ||
+ | Serial.println("FAR"); | ||
+ | break; | ||
+ | default: | ||
+ | Serial.println("NONE"); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | '''颜色识别''' | ||
+ | *本传感器识别出不同颜色的RGB值 | ||
+ | *该例程效果为:下载程序后,保持USB线连接,打开串口(波特率设置为9600),观察返回值。 | ||
+ | **用Sensor-Ges&RGB识别不同颜色的RGB值 | ||
+ | **推荐距离:被测颜色与Sensor-Ges&RGB垂直距离3cm左右为最佳,并根据实际情况进行调整 | ||
+ | **注:外界环境光对识别到的RGB值会有影响 | ||
+ | <source lang="cpp"> | ||
+ | #include <Microduino_Gesture.h> | ||
+ | // Global Variables | ||
+ | Gesture gestureSensor; | ||
+ | void setup() { | ||
+ | // put your setup code here, to run once: | ||
+ | Serial.begin(9600); | ||
+ | // Initialize Gesture (configure I2C and initial values) | ||
+ | gestureSensor.begin(); | ||
+ | // Start running the Gesture light sensor (no interrupts) | ||
+ | gestureSensor.enableLightSensor(false); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | // Read the light levels (ambient, red, green, blue) | ||
+ | Serial.print("Ambient: "); | ||
+ | Serial.print(gestureSensor.readAmbientLight()); | ||
+ | Serial.print(" Red: "); | ||
+ | Serial.print(gestureSensor.readRedLight()); | ||
+ | Serial.print(" Green: "); | ||
+ | Serial.print(gestureSensor.readGreenLight()); | ||
+ | Serial.print(" Blue: "); | ||
+ | Serial.println(gestureSensor.readBlueLight()); | ||
+ | // Wait 1 second before next reading | ||
+ | delay(1000); | ||
+ | } | ||
+ | </source> | ||
+ | 在室内白色灯光且无阳光直射的环境下测试得到颜色RGB返回值为: | ||
+ | [[file:Microduino-Sensor-Ges&RGB_1.JPG|600px|center|颜色RGB返回值]] | ||
+ | <p style="font-size:125%">库语法手册</p><big>[[Sensor-Ges&RGB Reference|Sensor-Ges&RGB Reference]]</big> | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''文档'''</p> | ||
+ | *传感器CAD图纸:'''[[File:Sensor_CAD.pdf]]''' | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''注意事项'''</p> | ||
+ | *手势识别时动作是否标准会影响识别的准确度,使用最佳距离在10cm以内 | ||
+ | *颜色识别时外界环境光对识别到的RGB值会有影响 | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''示例教程'''</p> | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''Q&A'''</p> | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:155%">'''历史'''</p> | ||
+ | <br> | ||
+ | ---- | ||
+ | <br> | ||
+ | <p style="color: #333333;font-size:135%">'''图库'''</p> | ||
+ | {| border="0" cellpadding="10" width="100%" | ||
+ | |- | ||
+ | |width="50%" valign="top" align="left"| | ||
+ | [[file:Microduino-Sensor-Ges&RGB1.JPG|thumb|400px|center|Sensor-Ges&RGB Front]] | ||
+ | |width="50%" valign="top" align="left"| | ||
+ | [[file:Microduino-Sensor-Ges&RGB-b1.JPG|thumb|400px|center|Sensor-Ges&RGB Back]] | ||
+ | |} | ||
+ | |} | ||
+ | <p style="font-size:150%">[[MCookie 传感器系列|返回Sensor界面]]</p> | ||
+ | <br> | ||
<br> | <br> |
2018年5月16日 (三) 10:29的最新版本
| |
|
技术规格
引脚
编程手册 手势识别
#include <Microduino_Gesture.h>
// Global Variables
Gesture gestureSensor;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
// Initialize Gesture (configure I2C and initial values)
gestureSensor.begin() ;
// Start running the Gesture gesture sensor engine
gestureSensor.enableGestureSensor(true);
}
void loop() {
if ( gestureSensor.isGestureAvailable() ) {
switch ( gestureSensor.readGesture() ) {
case DIR_UP:
Serial.println("UP");
break;
case DIR_DOWN:
Serial.println("DOWN");
break;
case DIR_LEFT:
Serial.println("LEFT");
break;
case DIR_RIGHT:
Serial.println("RIGHT");
break;
case DIR_NEAR:
Serial.println("NEAR");
break;
case DIR_FAR:
Serial.println("FAR");
break;
default:
Serial.println("NONE");
}
}
}
颜色识别
#include <Microduino_Gesture.h>
// Global Variables
Gesture gestureSensor;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
// Initialize Gesture (configure I2C and initial values)
gestureSensor.begin();
// Start running the Gesture light sensor (no interrupts)
gestureSensor.enableLightSensor(false);
}
void loop() {
// Read the light levels (ambient, red, green, blue)
Serial.print("Ambient: ");
Serial.print(gestureSensor.readAmbientLight());
Serial.print(" Red: ");
Serial.print(gestureSensor.readRedLight());
Serial.print(" Green: ");
Serial.print(gestureSensor.readGreenLight());
Serial.print(" Blue: ");
Serial.println(gestureSensor.readBlueLight());
// Wait 1 second before next reading
delay(1000);
}
在室内白色灯光且无阳光直射的环境下测试得到颜色RGB返回值为: 库语法手册 Sensor-Ges&RGB Reference
文档
注意事项
示例教程
Q&A
历史
图库 |