Rohan Barnwal
Published © GPL3+

Smart Presentation Controller using DFRobot GR10-30 Gesture

The Smart Presentation Controller lets you navigate slides hands-free using simple hand gestures

BeginnerFull instructions provided1 hour3
Smart Presentation Controller using DFRobot GR10-30 Gesture

Things used in this project

Hardware components

DFRobot GR10-30 Gesture Sensor
×1
Arduino micro PRO (HID)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Connections

Code

Code

Arduino
#include <Wire.h>
#include "DFRobot_GR10_30.h"
#include <Keyboard.h>

#define I2CMODE

DFRobot_GR10_30 gr10_30(/*addr = */GR10_30_DEVICE_ADDR, /*pWire = */&Wire);

void setup() {    
  Serial.begin(115200);    
  Keyboard.begin(); // Initialize Keyboard functionality      
  
  while (gr10_30.begin() != 0) {      
    Serial.println("Sensor initialization failed!");      
    delay(1000);    
  }    

  Serial.println("Sensor initialized successfully!");
  gr10_30.enGestures(GESTURE_LEFT | GESTURE_RIGHT); // Enable left and right gestures  
}

void loop() {
  if (gr10_30.getDataReady()) {
    uint16_t gestures = gr10_30.getGesturesState();

    if (gestures & GESTURE_LEFT) {
      Serial.println("Right gesture detected");
      Keyboard.press(KEY_LEFT_ARROW);
      delay(100);
      Keyboard.release(KEY_LEFT_ARROW);
    }    

    if (gestures & GESTURE_RIGHT) {
      Serial.println("Left gesture detected");
      Keyboard.press(KEY_RIGHT_ARROW);
      delay(100);  
      Keyboard.release(KEY_RIGHT_ARROW);
    }
  }  

  delay(1); // Small delay for stability  
}

Credits

Rohan Barnwal
40 projects • 36 followers
Rohan Barnwal - maker, hacker, tech enthusiast. I explore new tech & find innovative solutions. See my projects on hackster.io!

Comments