Skip to main content
Any Framework

PAJ7620U2 gesture sensor binding for .NET nanoFramework C# projects

Published
Jun 22, 2026
4mo ago
Total Downloads
475
475

Install

dotnet add package nanoFramework.Iot.Device.Paj7620 --version 1.0.22

No framework information available.

README

PAJ7620U2 gesture sensor

Iot.Device.Paj7620 is a .NET nanoFramework binding for the PixArt PAJ7620U2 gesture sensor.

Features

  • I2C communication (0x73 default address)
  • Device ID validation during initialization
  • Seeed-compatible initialization sequence
  • Gesture decoding for:
    • Up, Down, Left, Right
    • Forward, Backward
    • Clockwise, CounterClockwise
    • Wave

Usage

Create Paj7620, call Initialize(), then poll TryReadGesture(...).

using Iot.Device.Paj7620;
using System.Device.I2c;
using System.Diagnostics;
using System.Threading;
using nanoFramework.Hardware.Esp32;

Configuration.SetPinFunction(Gpio.IO05, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(Gpio.IO06, DeviceFunction.I2C1_CLOCK);

I2cConnectionSettings settings = new(1, Paj7620.DefaultI2CAddress);

using (Paj7620 sensor = new(I2cDevice.Create(settings)))
{
    sensor.GestureDebounceMilliseconds = 500;

    sensor.Initialize();
    Debug.WriteLine("PAJ7620 initialized.");

    while (true)
    {
        if (sensor.TryReadGesture(out Gesture gesture))
        {
            Debug.WriteLine($"Gesture: {gesture}");
        }

        Thread.Sleep(50);
    }
}

See samples for a complete sample application.

Gesture mapping

The driver maps gesture result bitfields to the enum Gesture as follows:

  • 0x0001 -> Up
  • 0x0002 -> Down
  • 0x0004 -> Left
  • 0x0008 -> Right
  • 0x0010 -> Forward
  • 0x0020 -> Backward
  • 0x0040 -> Clockwise
  • 0x0080 -> CounterClockwise
  • 0x0100 -> Wave

Notes

  • The sensor requires successful Initialize() before reads.
  • There is a default 500 ms debounce period after each detected gesture. This can be adjusted at runtime using sensor.GestureDebounceMilliseconds.
  • Polling intervals between 20 ms and 100 ms are commonly stable in practice.
  • Reliable detection depends on distance, hand speed, and ambient conditions.
  • The sample uses I2C pins 5 (SDA) and 6 (SCL) on ESP32. Adjust pin configuration as needed for your board and wiring.

Changes from Previous Version

No structural changes between v1.0.1 and v1.0.22.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.