“GestureSensor.begin()”的版本间的差异
(未显示同一用户的2个中间版本) | |||
第9行: | 第9行: | ||
begin()里面可以不写任意参数 | begin()里面可以不写任意参数 | ||
<p style="color: #E87E05;font-size:135%">返回值</p> | <p style="color: #E87E05;font-size:135%">返回值</p> | ||
− | + | 无 | |
<p style="color: #E87E05;font-size:135%">示例</p> | <p style="color: #E87E05;font-size:135%">示例</p> | ||
第15行: | 第15行: | ||
#include <Microduino_Gesture.h> | #include <Microduino_Gesture.h> | ||
+ | |||
// Global Variables | // Global Variables | ||
Gesture gestureSensor; | Gesture gestureSensor; | ||
第27行: | 第28行: | ||
} else { | } else { | ||
Serial.println(F("Something went wrong during Gesture init!")); | Serial.println(F("Something went wrong during Gesture init!")); | ||
+ | } | ||
+ | |||
+ | // Start running the Gesture gesture sensor engine | ||
+ | if ( gestureSensor.enableGestureSensor(true) ) { | ||
+ | Serial.println(F("Gesture sensor is now running")); | ||
+ | } else { | ||
+ | Serial.println(F("Something went wrong during gesture sensor init!")); | ||
} | } | ||
} | } | ||
void loop() { | void loop() { | ||
− | + | } | |
</source> | </source> | ||
<p style="color: #E87E05;font-size:135%">其他</p> | <p style="color: #E87E05;font-size:135%">其他</p> | ||
− | * | + | *[[gestureSensor.setGestureGain()|setGestureGain()]] |
− | * | + | *[[gestureSensor.enableGestureSensor()|enableGestureSensor()]] |
− | * | + | *[[gestureSensor.enableLightSensor() |enableLightSensor()]] |
− | * | + | *[[gestureSensor.isGestureAvailable()|isGestureAvailable()]] |
− | * | + | *[[gestureSensor.readAmbientLight()|readAmbientLight()]] |
− | * | + | *[[gestureSensor.readRedLight()|readRedLight())]] |
− | * | + | *[[gestureSensor.readGreenLight()|readGreenLight()]] |
− | * | + | *[[gestureSenso.readBlueLight()|readBlueLight]] |
− | * | + | *[[gestureSenso.readProximity()|readProximity()]] |
− | * | + | *[[gestureSenso.readGesture() |readGesture()]] |
|} | |} |
2018年5月16日 (三) 07:29的最新版本
GestureSensor.begin()
描述 手势初始化,配置I2C和初始值。 参数 begin()里面可以不写任意参数 返回值 无 示例 #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!"));
}
// Start running the Gesture gesture sensor engine
if ( gestureSensor.enableGestureSensor(true) ) {
Serial.println(F("Gesture sensor is now running"));
} else {
Serial.println(F("Something went wrong during gesture sensor init!"));
}
}
void loop() {
}
其他 |