Gesture Control With Maker Nano RP2040 And APDS9960


In this tutorial today, we shall see how to interface Maker Nano RP2040, APDS 9960 and servo motor to perform a gesture control


Hardware Preparation

For this tutorial we will need the following components

dcim101mediadji 0277.jpg

Building The Circuit

To interface all the components together, i have decided to built a simple circuit on a donut board. The circuit is as shown below

untitled sketch schem

Please do note that the Arduino shown in the image above is the classic Arduino Nano. I have this, because there is no library for Maker Nano RP2040 yet inside the Fritzing.


Below is the complete code that we have used in this tutorial

#include "Adafruit_APDS9960.h"
#include <Servo.h>
Adafruit_APDS9960 apds;
Servo myservo1,myservo2;

// the setup function runs once when you press reset or power the board
void setup() {
  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

// 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) 
  if (gesture == APDS9960_UP) 
  if (gesture == APDS9960_LEFT)
  if (gesture == APDS9960_RIGHT) 

Thank You

Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.

Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for a better application.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Detect RGB Color With Raspberry Pi Pico
Build an IoT Project Using LoRaWAN Network with Cytron LoRa-RFM Shield and Helium Console
Measure Soil Moisture Sensor Using Raspberry Pi Pico And Maker Soil Moisture Sensor
Getting Started Raspberry Pi Compute Module 4 Lite And Mini Base (A) Board (CM4-IO-BASE-A)
Measure The Ambient Temperature With Raspberry Pi Pico And Grove Temperature Sensor Using Arduino IDE
Tutorials of Cytron Technologies Scroll to Top