WHAT IS HOVER?
Hover is a development kit that lets you control your hardware projects in a whole new way. Wave goodbye to physical buttons. Hover detects hand movements in the air for touch-less interaction. It also features five touch-sensitive regions for even more options.
- STEP 1: HOOKUP
- STEP 2: INSTALL THE LIBRARY
- STEP 3: RUN THE EXAMPLE SKETCH
- STEP 4: READING EVENT VALUES
WHAT YOU NEED TO GET STARTED
- pcDuino: You can use any pcDuino board with Hover.
- Hover: The magical board that lets you control your hardware projects with gestures.
- Breadboard: Hover will need to be connected to a breadboard using the 7-pin header.
- Jumper wires: You need 7 of these to connect Hover.
Use the diagram below to connect Hover to your pcDuino board. Here’s a description of all the relevant pins:
- HOST_V+: Connect the HOST_V+ pin to the 3.3V pin on pcDuino.
- RESET and TS: These pins are used by the library to configure Hover. These can be connected to any GPIO pins of pcDuino. Default library uses GPIO 4 for RESET and GPIO 2 for TS.
- SCL and SDA: The I2C pins are used to read data from Hover. Connect SCL/SDA on Hover directly to the SCL0/SDA0 of the pcDuino.
- 3V3 and GND: The 3.3V power supply and ground pins are used to power Hover. Connect these to the 3.3V and GND pins on pcDuino.
With the hardware setup, we’ll need to install the library before we can start hovering. The Hover library lets you easily incorporate gesture and touch events into your projects. We’ve added the library and example code on Github. Hit the link to grab the latest version.
First, run the commands to make sure you have the most updated I2C files:
- sudo apt-get install python-smbus
- sudo apt-get install i2c-tools
Next, plug in your pcDuino and boot it up. Make sure the Hover_example.py and Hover_library.py are in the same folder. Run sudo i2cdetect -y 2 to check if pcDuino can see the Hover on the i2c bus. If you see 42, you’re all set.
Now run sudo python Hover_example.py and you will see ‘Initializing Hover.. please wait’.
Wait a few seconds and you should see a ‘Hover is ready’ message. You can now start waving your hands in the air right above the Hover board in four directions: up, down, left, right. With each swipe of the hand, you should see the corresponding output on the serial monitor window. You can also tap any of the five electrodes (north, south, east, west, and center) and see the output on the serial monitor.
As you may have noticed, each hand wave outputs a specific 8-bit binary value followed by the decoded event type in text (e.g. 00100010 = Swipe Right). The event variable holds the 8-bit binary value to indicate the event type, gesture direction, and tap location.
The upper 3 bits indicates the event type: gesture or tap. The lower 5 bits indicates the gesture direction or tap location. See the image below for all possible combinations of the bit pattern.
These patterns make it easy for you to integrate gestures and taps intro your code. For example, if you only need to detect gestures for your project, consider writing if statements where you check the event variable for the four specific gesture patterns: 01010000, 0100100, 01000100, 01000010.
The original post from http://www.hoverlabs.co/pcduino