MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MatrixGesture Class Reference

A class for MATRIX Gesture Seneor. More...

#include <MiniR4_MXGesture.h>

Classes

struct  sGestureDescription_t
 

Public Types

enum  eGesture_t {
  eGestureNone = 0x00 , eGestureRight = 0x01 << 0 , eGestureLeft = 0x01 << 1 , eGestureUp = 0x01 << 2 ,
  eGestureDown = 0x01 << 3 , eGestureForward = 0x01 << 4 , eGestureBackward = 0x01 << 5 , eGestureClockwise = 0x01 << 6 ,
  eGestureAntiClockwise = 0x01 << 7 , eGestureWave = 0x01 << 8 , eGestureWaveSlowlyDisorder = 0x01 << 9 , eGestureWaveSlowlyLeftRight ,
  eGestureWaveSlowlyUpDown , eGestureWaveSlowlyForwardBackward , eGestureAll = 0xff
}
 gesture information More...
 
enum  eBank_t { eBank0 = 0 , eBank1 = 1 }
 Register Bank. More...
 
enum  eRateMode_t { eNormalRate = 0 , eGamingRate = 1 }
 Gesture Update Rate. More...
 

Public Member Functions

int begin (void)
 init function
 
void setGestureHighRate (bool b)
 Set gesture detection mode.
 
String gestureDescription (int gesture)
 Get the string descritpion corresponding to the gesture number.
 
int getGesture (void)
 Get gesture.
 

Public Attributes

uint8_t _ch = 0
 
TwoWire * _pWire
 

Detailed Description

A class for MATRIX Gesture Seneor.

This class allows reading 9 gesture from the MATRIX Gesture Seneor.

Definition at line 101 of file MiniR4_MXGesture.h.

Member Enumeration Documentation

◆ eBank_t

Register Bank.

Enumerator
eBank0 

some registers are located in Bank0

eBank1 

some registers are located in Bank1

Definition at line 137 of file MiniR4_MXGesture.h.

◆ eGesture_t

gesture information

Enumerator
eGestureNone 

no gestures detected

eGestureRight 

move from left to right

eGestureLeft 

move from right to left

eGestureUp 

move from down to up

eGestureDown 

move form up to down

eGestureForward 

starts far, move close to sensor

eGestureBackward 

starts near, move far to sensor

eGestureClockwise 

clockwise

eGestureAntiClockwise 

anti-clockwise

eGestureWave 

wave quickly

eGestureWaveSlowlyDisorder 

wave randomly and slowly

eGestureWaveSlowlyLeftRight 

slowly move left and right

eGestureWaveSlowlyUpDown 

slowly move up and down

eGestureWaveSlowlyForwardBackward 

slowly move forward and backward

eGestureAll 

support all gestures, no practical meaning, only suitable for writing abstract program logic.

Definition at line 110 of file MiniR4_MXGesture.h.

◆ eRateMode_t

Gesture Update Rate.

Enumerator
eNormalRate 

Gesture Update Rate is 120HZ, Gesture speed is 60°/s - 600°/s

eGamingRate 

Gesture Update Rate is 240HZ,Gesture speed is 60°/s - 1200°/s

Definition at line 146 of file MiniR4_MXGesture.h.

Member Function Documentation

◆ begin()

int MatrixGesture::begin ( void )

init function

Returns
return 0 if initialization succeeds, otherwise return non-zero.

Definition at line 17 of file MiniR4_MXGesture.cpp.

◆ gestureDescription()

String MatrixGesture::gestureDescription ( int gesture)

Get the string descritpion corresponding to the gesture number.

Parameters
gestureGesture number inlcuded in the int
Returns
Textual description corresponding to the gesture number:if the gesture input in the gesture table doesn't exist,
return null string.

Definition at line 43 of file MiniR4_MXGesture.cpp.

◆ getGesture()

int MatrixGesture::getGesture ( void )

Get gesture.

Returns
Return gesture, could be any value except Gesture Code in int

Definition at line 56 of file MiniR4_MXGesture.cpp.

◆ setGestureHighRate()

void MatrixGesture::setGestureHighRate ( bool b)

Set gesture detection mode.

Parameters
btrue Set to fast detection mode (default) can recognize 9 gestures, False: slow mode will have 4 expanded gestures.

Definition at line 54 of file MiniR4_MXGesture.cpp.

Member Data Documentation

◆ _ch

uint8_t MatrixGesture::_ch = 0

Definition at line 103 of file MiniR4_MXGesture.h.

◆ _pWire

TwoWire* MatrixGesture::_pWire

Definition at line 104 of file MiniR4_MXGesture.h.


The documentation for this class was generated from the following files: