“GestureSenso.readProximity()”的版本间的差异
(创建页面,内容为“{| style="width: 800px;" |- | <p style="color: #666666;font-size:220%">'''GestureSenso.readProximity()'''</p> <br> <p style="color: #E87E05;font-size:135%">描述</p…”) |
502748957@qq.com(讨论 | 贡献) |
||
第53行: | 第53行: | ||
</source> | </source> | ||
<p style="color: #E87E05;font-size:135%">其他</p> | <p style="color: #E87E05;font-size:135%">其他</p> | ||
− | *[[ | + | *[[gestureSensor.begin()|begin()]] |
*[[gestureSensor.setGestureGain()|setGestureGain()]] | *[[gestureSensor.setGestureGain()|setGestureGain()]] | ||
*[[gestureSensor.enableGestureSensor()|enableGestureSensor()]] | *[[gestureSensor.enableGestureSensor()|enableGestureSensor()]] |
2018年5月16日 (三) 09:43的最新版本
GestureSenso.readProximity()
描述 读取距离值 参数 无 返回值 距离的数值 示例 #include <Microduino_Gesture.h>
// Global Variables
Gesture gestureSensor;
void setup() {
// Initialize Serial port
Serial.begin(9600);
// Initialize Gesture (configure I2C and initial values)
if ( gestureSensor.begin() ) {
Serial.println(F("Gesture initialization complete"));
} else {
Serial.println(F("Something went wrong during Gesture init!"));
}
// Adjust the Proximity sensor gain
if ( !gestureSensor.setProximityGain(PGAIN_2X) ) {
Serial.println(F("Something went wrong trying to set PGAIN"));
}
// Start running the Gesture proximity sensor (no interrupts)
if ( gestureSensor.enableProximitySensor(false) ) {
Serial.println(F("Proximity sensor is now running"));
} else {
Serial.println(F("Something went wrong during sensor init!"));
}
}
void loop() {
Serial.print("Proximity: ");
Serial.println(gestureSensor.readProximity());
// Wait 250 ms before next reading
delay(250);
}
其他 |