GestureSensor.enableLightSensor()
502748957@qq.com(讨论 | 贡献)2018年5月16日 (三) 09:37的版本
GestureSensor.enableLightSensor()
描述 使能传感器中的光电传感器 参数 true false 使能或不使能 返回值 true false 使能成功或失败 示例 #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 light sensor (no interrupts)
if ( gestureSensor.enableLightSensor(false) ) {
Serial.println(F("Light sensor is now running"));
} else {
Serial.println(F("Something went wrong during light sensor init!"));
}
// Wait for initialization and calibration to finish
delay(500);
}
void loop() {
}
其他 |