I got my hands on one of these and the first thing that came to my mind was to use it to add gesture controls for Screenly OSE.
First, you need to install the driver and Python library for the Flick, this is as simple as typing in one command. Once installed, you can use the test application to ensure that it is working properly.
With the Flick installed, install Screenly OSE. Similarly, it’s just one line of code. This installation will however take a bit longer, as it requires a fair number of dependencies to be installed.
In terms of hardware, my particular setup is using a pi-topCEED, which is a great little hardware kit. It also hides the board behind plexiglass, creating a better looking device. Unfortunately, since I didn’t have any pi-topPROTO, I had to run a separate power cable to power the Raspberry Pi in order to use it with the Flick.
I had to disable the pi-top power supply to the Raspberry Pi to fit the Flick HAT.
Since my objective was simply to detect movement, the coding part was very straight forward. In short, the script below simply compares the previous and current state of the sensor to determine if there was a movement. If a movement is detected, the script sends a SIGUSR1 signal to viewer.py which causes it to jump to the next image.
<iframe src=”https://medium.com/media/87a5c74f1a3858cef3d1316fd45ceeba” frameborder=0></iframe>
The approach is very much similar to the approach used in the previous article How to add a physical button to Screenly OSE using Node-RED.
To better get an idea on how this work, I recorded a quick video on how everything works nicely together.