Beyond having a really cool 8x8 LED Matrix and a myriad of sensors, you are also given a joystick input on the device. To me, one of the quickest and most impactful demo applications is showing that the joystick input on the Sense HAT can be used to control your smart home devices. In our case, we wanted to connect and work with a Philips Hue internet connected lightbulb.
To replicate this project:
- Set up a Raspberry Pi with Raspbian (extra points for setting up wifi!)
- Install the HAT and set up the Raspberry Pi Sense Hat software
- Install evdev for joystick use
sudo pip3 install evdev(you may need to run
sudo apt-get install python3-pip
- Set up your Philips Hue lights based upon the instructions provided (use the app at first to make sure they work!)
- Go through the getting started steps for the Hue API
- Take note of the URL you are using to interact with the light’s hue, as it will be used in our code.
- Save the code at the bottom of the page as sense_hue.py
You should be able to start using the joystick to change the Hue by moving to the left or right and change the brightness by moving the joystick up and down.