“GestureSensor.setGestureGain()”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
 
第5行: 第5行:
 
<br>
 
<br>
 
<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>
 
GGAIN_1X;GGAIN_2X;GGAIN_4X;GGAIN_8X
 
GGAIN_1X;GGAIN_2X;GGAIN_4X;GGAIN_8X

2018年5月16日 (三) 09:34的最新版本

GestureSensor.setGestureGain()


描述

设置增益倍数,可用于不同环境下调整传感器性能

参数

GGAIN_1X;GGAIN_2X;GGAIN_4X;GGAIN_8X

返回值

示例

#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!"));
  }

  if (gestureSensor.setGestureGain(GGAIN_2X)) { //GGAIN_1X GGAIN_2X GGAIN_4X GGAIN_8X
    Serial.println(F("Gesture setGestureGain complete"));
  } else {
    Serial.println(F("Something went wrong during APDS-9960 setGestureGain!"));
  }

  // 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() {
    }
}

其他