Reference
Last revision 2026/01/12
Library
- Download and install the PAJ7620U2 Example Library. (About how to install the library?)
API Description
Functions for reference:
DFRobot_PAJ7620U2(TwoWire *pWire=&Wire);
/**
* @brief Constructor
* @param mode Call the function and designate the device's default working mode.
*/
int begin(void)
/**
* @brief Init function
* @return Return 0 if the initialization succeeds, otherwise return non-zero.
*/
void setGestureHighRate(bool b);
/**
* @brief Set the gesture recognition mode
* @param b true Fast detection mode, recognize gestures quickly and return.
* @n false Slow detection mode, the system will do more judgements.
* @n In fast detection mode, the sensor can recognize 9 gestures: move left, right, up, down, forward,
* @n backward, clockwise, counter-clockwise, wave.
* @n To detect the combination of these gestures, like wave left, right and left quickly, users need to
* @n design their own algorithms logic.
* @n Since users only use limited gestures, we didn't integrate too much expanded gestures in the library.
* @n If necessary, you can complete the algorithm logic in the ino file by yourself.
* @n
* @n
* @n In slow detection mode, the sensor recognize one gesture every 2 seconds, and we have integrated the
* @n expanded gestures inside the library, which is convenient for the beginners to use.
* @n The slow mode can recognize 9 basic gestures and 4 expanded gestures: move left, right, up, down,
* @n forward, backward, clockwise, counter-clockwise, wave, slowly move left and right, slowly move up
* @n and down, slowly move forward and backward, wave slowly and randomly.
*/
String gestureDescription(eGesture_t gesture);
/**
* @brief Get the string descritpion corresponding to the gesture number.
* @param gesture Gesture number inlcuded in the eGesture_t
* @return Textual description corresponding to the gesture number:if the gesture input in the gesture table
* @n doesn't exist, return null string
* @n Normally, it may return "None","Right","Left", "Up", "Down", "Forward", "Backward", "Clockwise",
* @n "Anti-Clockwise", "Wave", "WaveSlowlyDisorder", "WaveSlowlyLeftRight", "WaveSlowlyUpDown",
* @n "WaveSlowlyForwardBackward"
*/
eGesture_t getGesture(void);
/**
* @brief Get gesture
* @return The gesture value it may return: eGestureNone eGestureRight eGestureLeft eGestureUp
* @n eGestureDown eGestureForward eGestureBackward eGestureClockwise
* @n eGestureWave eGestureWaveSlowlyDisorder eGestureWaveSlowlyLeftRight
* @n eGestureWaveSlowlyUpDown eGestureWaveSlowlyForwardBackward
*/
Other Supplementary Information
Was this article helpful?
