Gesture Mode Features - acrandal/RevEng_PAJ7620 GitHub Wiki

Gesture Mode Features

Wave Count

Bank 0 - 0xB7 - [3:0] - "WaveCount"

Counts the quantity of "waves" (passes left/right) of an object. This returns a value 0..15. The register can be called any time, even during the wave gesture is ongoing. For example, you can query wave count multiple times while the user is still waving and get increasing values up to 15.

Important: the wave interrupt will not be thrown until the person stops waving. If they keep waving no event will be triggered/thrown, but the wave count register will start counting as soon as they start waving.


No Object Count

Bank 0 - 0xB8 - [7:0] - "NoObjectCount"

Counts a number of ticks since there was no object in view. Register mentioned in v1.0 datasheet. A "tick" is around 7.28ms, experimentally derived in "normal" speed and 4.1ms in "game" mode.

Exposed in API as: int getNoObjectCount();


No Motion Count

Bank 0 - 0xB9 - [7:0] - "NoMotionCount"

Counts a number of ticks since an object in view was moving. No definition of "moving" available, but likely some threshold on quantity of changes in pixels.

Errata: Returns a value in range 0..12 instead of 0..255. My code seems fine, so I'm not sure why it caps out at 12 (0x0C).


Get Object Center X & Y

The "center" of the object in view can be polled.

  • Bank 0 - 0xAC & 0xAD - [12:0] - ObjectCenterX
  • Bank 0 - 0xAE & 0xAF - [12:0] - ObjectCenterY

It seems to be working just fine in gesture mode. I don't think I can control the resolution like I can in cursor mode, but there it is. The other biggie is that cursor mode has clamping on the edges of the field of view. That gives the user a larger region to rest at min/max values while gesture mode doesn't have that feature built in.

The coordinates follow the default gesture coordinates, so X is inverted. That means it's 0 on the right.


Get Object Velocity X & Y

There's registers to read out an object's X & Y velocities.

  • Bank 0 - 0xC3 & 0xC4 - [11:0] - ObjectVelX
  • Bank 0 - 0xC5 & 0xC6 - [11:0] - ObjectVelY

getObjectVelX() and getObjectVelY()

Return values between -63 and +63. This is because only the LSB [6..0] return the data values. Bits [11..7] are all 0 for positive direction velocity and all 1's for negative direction velocities. Bits [15..12] are unused.

The registers also stay loaded with values when the object leaves view (sometimes). I've created API calls for a filtered (normal) call, and a _raw() version for just pulling the registers. I use a new isObjectInView() interface to filter out definitely bad velocity values.