Example Code for Raspberry Pi-UART Gesture Sensor
This article details the process of setting up a Raspberry Pi with a UART gesture sensor including hardware and software preparations, installation commands, and execution of sample code for reading gesture and touch data.
Hardware Preparation
- Raspberry Pi 4B x1
- IO Expansion HAT for Raspberry Pi x1
- HDMI Cable x1
- Display x1
- Keyboard and Mouse x1
- SEN0285 Gesture&Touch Sensor x1
Software Preparation
- Enable Raspberry Pi I2C interface. (Way to enable SPI is the same with IIC). Skip this step if it is already enabled.
- Install Phython demo library and git, and make sure the network connection of Raspberry Pi is fine. Skip this step if these have been installed.
command: cd ~
command: git clone https://github.com/DFRobot/DFRobot_Gesture_Touch.git
command:sudo unzip DFRobot_Gesture_Touch-main.zip
command: cd DFRobot_Gesture_Touch-main/raspberry/python/examples/demo_gesture_touch
Other Preparation Work
- Connect SEN0285 Gesture&Touch Sensor to UART port.
Sample Code
command: python demo_gesture_touch.py
Result
Read gesture and touch data via UART.
Was this article helpful?
