Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustment of the gesture detection #36

Open
Herodotmaximus94 opened this issue Mar 9, 2022 · 0 comments
Open

Adjustment of the gesture detection #36

Herodotmaximus94 opened this issue Mar 9, 2022 · 0 comments

Comments

@Herodotmaximus94
Copy link

Hello,
I state the problem, that I want to achieve a gesture detection with a proximity adjustment.
The proximity value will not reach 0 and will be above 130 so no gesture is read. Is there anyone who could help me and is there a way to do so in the code?
I am using the gesture example right now and tested around with the setGestureGain and setADCGain functions with no result.
If I use the proximity mode, I got values between 130 and 255 so it is still working as intended.
Thank you for the answers.

#include "Adafruit_APDS9960.h"
Adafruit_APDS9960 apds;


// the setup function runs once when you press reset or power the board
void setup() {
  Serial.begin(115200);

  
  if(!apds.begin()){
    Serial.println("failed to initialize device! Please check your wiring.");
  }
  else Serial.println("Device initialized!");

  //gesture mode will be entered once proximity mode senses something close
  //apds.enableProximity(true);
  apds.enableGesture(true);

  //apds.setGestureProximityThreshold(135);
  apds.setGestureGain(0x02); //sets gesture gain to 4x
  apds.setADCGain(0x03); //sets ambientlight gain to 64x

}



// the loop function runs over and over again forever
void loop() {
  //read a gesture from the device
    uint8_t gesture = apds.readGesture();
    if(gesture == APDS9960_DOWN) Serial.println("RIGHT");
    if(gesture == APDS9960_UP) Serial.println("RIGHT");
    if(gesture == APDS9960_LEFT) Serial.println("LEFT");
    if(gesture == APDS9960_RIGHT) Serial.println("LEFT");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant