#43532
Very frustrated with Gesture Recognition Touch Sensor
A buddy and I share this hobby together and we were excited to play with this gesture sensor on an Arduino Uno. But all we get is (-1) DF_ERR.

We have used this Arduino Uno board for other dev projects and we use the power supplied by USB cable from computer. We wired it up. Double checked each other's work. Checked the continuity of all connections with meter. Downloaded the software library and copied the sample code from GitHub. We get a clean compile. We are getting a response from the instantiated object. The only response is DF_ERR. No response to gestures. No response to touch pad.

We may have bad hardware. Are there other tests I might be able to try?
#43572
Device used: https://www.dfrobot.com/product-1898.html

Sketch is a virtual duplicate of downloaded example from GitHub:

#include "DFRobot_Gesture_Touch.h"
#ifdef __AVR__
#include "SoftwareSerial.h"
SoftwareSerial mySerial(10, 11); // example for uno, use software serial
#elif defined ESP_PLATFORM
#include "HardwareSerial.h"
HardwareSerial mySerial(1);
#endif

DFRobot_Gesture_Touch DFGT(&mySerial); // init sensor object, request write and read function

void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
delay(2000);
while(mySerial.available()) // flush serial buffer
mySerial.read();
Serial.println("gesture&touch sensor test");

DFGT.setGestureDistance(20); // suggest default value
DFGT.enableFunction(DFGT_FUN_ALL); // enable all functions
// DFGT.disableFunction(DFGT_FUN_RIGHT | DFGT_FUN_LEFT); // disable function test
// DFGT.enableFunction(DFGT_FUN_RIGHT | DFGT_FUN_LEFT); // enable function test
// DFGT.setSleep(4); // set auto sleep time out, in sleep mode, something approach will weak it up
}

void loop()
{
int8_t rslt = DFGT.getAnEvent(); // get an event that data saved in serial buffer

if(rslt != DF_ERR) {
// DFGT.setSleep(DFGT_SLEEP_DISABLE); // disable auto sleep
switch(rslt) {
case DFGT_EVT_BACK:
Serial.println("get event back");
break;
case DFGT_EVT_FORWARD:
Serial.println("get event forward");
break;
case DFGT_EVT_RIGHT:
Serial.println("get event right");
break;
case DFGT_EVT_LEFT:
Serial.println("get event left");
break;
case DFGT_EVT_PULLUP:
Serial.println("get event pull up");
break;
case DFGT_EVT_PULLDOWN:
Serial.println("get event pull down");
break;
case DFGT_EVT_PULLREMOVE:
Serial.println("get event pull and remove");
break;
case DFGT_EVT_TOUCH1:
Serial.println("get event touch1");
break;
case DFGT_EVT_TOUCH2:
Serial.println("get event touch2");
break;
case DFGT_EVT_TOUCH3:
Serial.println("get event touch3");
break;
case DFGT_EVT_TOUCH4:
Serial.println("get event touch4");
break;
case DFGT_EVT_TOUCH5:
Serial.println("get event touch5");
break;
default:
Serial.println("what?");
delay(1000);
break;
}
}
}
#43573
Thank you in advance for all your help.
... Since I tried (and failed with) this gesture sensor, I got two other gesture sensors. Different styles from different sources. One of them did work, so I am greatly relieved that I'm not actually crazy ... LOL ...
Again, thank you ... I look forward to your replies.