From 0a90da6e951753d72d1ba9aa0202cd726d8f26f7 Mon Sep 17 00:00:00 2001 From: Spencer Yan Date: Mon, 23 Sep 2024 11:08:57 +0800 Subject: [PATCH] chore(Grove-Gesture_v1.0.md): revised layout --- .../Proximity/Grove-Gesture_v1.0.md | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/docs/Sensor/Grove/Grove_Sensors/Proximity/Grove-Gesture_v1.0.md b/docs/Sensor/Grove/Grove_Sensors/Proximity/Grove-Gesture_v1.0.md index 2f105569c222..dd4931858ce9 100755 --- a/docs/Sensor/Grove/Grove_Sensors/Proximity/Grove-Gesture_v1.0.md +++ b/docs/Sensor/Grove/Grove_Sensors/Proximity/Grove-Gesture_v1.0.md @@ -7,19 +7,28 @@ keywords: image: https://wiki.seeedstudio.com/Grove-Gesture_v1.0/ slug: /Grove-Gesture_v1.0 last_update: - date: 01/05/2022 + date: 09/23/2024 author: gunengyu --- -![](https://files.seeedstudio.com/wiki/Grove_Gesture_V_1.0/img/400px-Gesture_sensor_3.png) +
+ +
+ +
+ + Get One Now 🖱️ + +


The sensor on Grove - Gesture is PAJ7620U2 that integrates gesture recognition function with general I2C interface into a single chip. It can recognize 9 basic gestures, and these gestures information can be simply accessed via the I2C bus. Application: You can use Gesture as an input device to control another grove, or a computer, mobile phone, smart car, robot, and more with a simple swipe of your hand. - ## Features @@ -106,7 +115,7 @@ Software Installation. - **Step 4.** Start the Arduino IDE, Let's try the up/down demo. - **Step 5.** Copy below code and paste to arduino IDE. -```cpp +```cpp showLineNumbers /* The following simple demo will show you a very easy application: When you move up, the red led will be turned on, otherwise the red led will be turned off. */ @@ -138,7 +147,7 @@ void loop() - **Step 8.** Let's try the 9 gestures by select **File->Example->Grove_Gesture->paj7620_9gestures**, then select Seeeduino v4 as board manager and correct COM port. -```cpp +```cpp title="paj7620_9gestures" showLineNumbers #include #include "paj7620.h" @@ -281,7 +290,7 @@ void loop() - **Step 9.** Click upload and open the Serial Monitor port. - **Step 10.** This example can recognize 9 gestures and output the result, including move up, move down, move left, move right, move forward, move backward, circle-clockwise, circle-counter clockwise, and wave. Let's try and see COM port output as below. -```cpp +```shell PAJ7620U2 TEST DEMO: Recognize 9 gestures. INIT SENSOR... Addr0 =20, Addr1 =76 @@ -360,24 +369,21 @@ Upload the program to your Arduino/Seeeduino. - **Step 1**. Follow [Setting Software](https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi/#installation) to configure the development environment. - **Step 2**. Download the source file by cloning the grove.py library. -``` +```shell cd ~ git clone https://github.com/Seeed-Studio/grove.py - ``` - **Step 3**. Excute below commands to run the code. -``` +```shell cd grove.py/grove python3 grove_gesture_sensor.py - ``` Following is the grove_gesture_sensor.py code. -```python - +```python title="grove_gesture_sensor.py" showLineNumbers import time,sys import RPi.GPIO as GPIO from grove.i2c import Bus @@ -900,8 +906,7 @@ if __name__ == "__main__": If everything goes well, you will be able to see the following result ::: -```python - +```shell pi@raspberrypi:~/grove.py/grove $ python3 grove_gesture_sensor.py wake-up finish. Paj7620 initialize register finished. @@ -912,12 +917,6 @@ Backward Right Up Down -^CTraceback (most recent call last): - File "grove_gesture_sensor.py", line 555, in - time.sleep(.1) -KeyboardInterrupt - - ``` You can quit this program by simply press ++ctrl+c++. @@ -962,7 +961,7 @@ python3 gesture_value.py Here is the code of gesture_value.py -```Python +```python #!/usr/bin/env python # # GrovePi Example for using the Grove - Gesture Sensor v1.0(https://www.seeedstudio.com/depot/Grove-Gesture-p-2463.html) @@ -1030,7 +1029,7 @@ while True: - **Step 4.** Here is the screen output. -```cpp +```cpp showLineNumbers pi@raspberrypi:~/Dexter/GrovePi/Software/Python/grove_gesture_sensor $ python3 gesture_value.py wake-up finish. Paj7620 initialize register finished.