9/25/2015 Grove Gesture v1.0 Wiki Grove - Gesture v1.0 From Wiki 来自痴汉的爱 Contents 1 Introduction 2 Features 3 Specification http://www.seeedstudio.com/wiki/Grove__Gesture_v1.
9/25/2015 Grove Gesture v1.0 Wiki 4 With Arduino/Seeeduino 4.1 Suggest Reading for Starter 4.2 Hardware Installation 4.3 Gesture Library 4.3.1 Setup 4.3.2 Simple Demo 4.3.3 Description of functions 4.3.3.1 1. Initialize the gesture sensor chip PAJ7620 4.3.3.2 2. Read data from PAJ7620 register via I2C 4.4 Gesture Examples/Applications 5 Resources Introduction The sensor on Grove - Gesture is PAJ7620U2 that integrates gesture recognition function with general I2C interface into a single chip.
9/25/2015 Grove Gesture v1.
9/25/2015 Grove Gesture v1.0 Wiki Plug Grove - Gesture onto the I2C port of Base shield Then plug Base shield onto the Arduino UNO http://www.seeedstudio.com/wiki/Grove__Gesture_v1.
9/25/2015 Grove Gesture v1.0 Wiki Gesture Library We have created a library to help you start playing quickly with the Seeeduino/Arduino, in this section we'll show you how to set up the library and introduce some of the functions. Setup 1. Download the library code as a zip file from the Gesture_PAJ7620 github page. (https://github.com/Seeed-Studio/Gesture_PAJ7620) 2. Unzip the downloaded file into your …/arduino/libraries. 3. Rename the unzipped folder "Gesture"(or:"Gesture_PAJ7620") 4.
9/25/2015 Grove Gesture v1.0 Wiki #include "paj7620.h" void setup() { paj7620Init(); } void loop() { uint8_t data = 0; // Read Bank_0_Reg_0x43/0x44 for gesture result.
9/25/2015 Grove Gesture v1.0 Wiki void setup() { paj7620Init(); } This initialization code should be added to each demo. 2. Read data from PAJ7620 register via I2C paj7620ReadReg(uint8_t addr, uint8_t qty, uint8_t data[]) addr: Register address qty: Number of data to read, addr continuously increase. data[]: The starting address(a variable or array) to store data. void loop() { uint8_t data = 0; // Read Bank_0_Reg_0x43/0x44 for gesture result.
9/25/2015 Grove Gesture v1.0 Wiki Gesture Examples/Applications These examples are going to show you how to recognize gestures from this Grove Gesture. Open File->Examples->Gesture(or:Gesture_PAJ7620)->example>paj7620_9gestures sketch for a complete example. Description: This example can recognize 9 gestures and output the result, including move up, move down, move left, move right, move forward, move backward, circleclockwise, circle-counter clockwise, and wave.
/25/2015 Grove Gesture v1.0 Wiki paj7620ReadReg(0x43, 1, &data); if(data == GES_FORWARD_FLAG) { Serial.println("Forward"); delay(GES_QUIT_TIME); } else if(data == GES_BACKWARD_FLAG) { Serial.println("Backward"); delay(GES_QUIT_TIME); } else { Serial.println("Right"); } break; case GES_LEFT_FLAG: delay(GES_ENTRY_TIME); paj7620ReadReg(0x43, 1, &data); if(data == GES_FORWARD_FLAG) { Serial.println("Forward"); delay(GES_QUIT_TIME); } else if(data == GES_BACKWARD_FLAG) { Serial.
9/25/2015 Grove Gesture v1.0 Wiki } } } delay(100); case GES_CLOCKWISE_FLAG: Serial.println("Clockwise"); break; case GES_COUNT_CLOCKWISE_FLAG: Serial.println("anti‐clockwise"); break; default: paj7620ReadReg(0x44, 1, &data1); if (data1 == GES_WAVE_FLAG) { Serial.println("wave"); } break; In your own project, you may need multi-gestures instead of a single gesture to realise one function , welcome to share! Resources Grove - Gesture_v1.0 sch pcb.zip (http://www.seeedstudio.