We wanted to create interactive sequence about schizophrenia related topics.
- Raspberry Pi 3 Model A+
- 4 pin RGB LED strip
- 2 MOSFET transistors
- 3 movement sensors
- jack connected, earphone-shaped speaker
- bluetooth speaker
- bluetooth remote button
-
White, pulsing light, ambient sounds from bt speaker - waiting for movement
-
Movement - telephone ring bell from bt speaker, red light, waiting for button push
-
After button push - psychodelic voice from jack speaker, red pulsing light, waiting for another button push
-
If push last:
-
> 3 sec - You lose, information about schizophrenia from bt speaker, red light
-
< 3 sec - You win, information about schizophrenia from bt speaker, white light
-
-
Break between sequences, ambient sounds from bt speaker, white pulsing lights
-
Repeat
- Not commented, messy code. It was written by one person in quite limited amount of time. But it is recoverable messy, it will be cleaned if we will be continuing our project.
- Bluetooth button - one hell ride with it - this technology it's not meant to be used on "wait long for input" mode. Remote is getting constantly disconnected. This is main reason why main program looks like it looks. In next iteration we will surely switch for cable-connected button and maybe speaker too.
- Movement sensors are too sensitive, we couldn't placed it in way that no sensor won't instantly sense a movement. Because of that we decided to add hardcoded pause between waiting for movement and continuing. On top of that I had to change mode of detecting - reacting to change from 0 (not detecting) to 1 (detecting) was replaced by just checking if even one sensor send 1.
- It was my playground for learning how to write someting asynchronized and multi-threaded.
- Using VLC python library - as much as it was the simplest sound player that I could find, later I would rather switch to something lighter.
- Search, trust, pair, disconnect after error (with possibilty of retries) with bluetooth device using bluetoothctl. After all it wasn't best choice to write this in python, it's look very messy. Bash scripts would fit much more. Unfortunatelly I didn't find any python library to get that much easy control of bluetooth like from bluetoothctl.
- Get pulse-audio sink from bluetooth speaker to later use it.
- Asynchronized waiting for bt button push.
- Managing pulse-audio sinks, possibility to create combined one.
- Control rgb led light using MOSFET transistor. We had only two because we wanted either only red or white light.
- Asynchronized waiting for movment detection.
- Install VLC
pip install -r requirments.txt
- From main directory:
pip install .
python[3] -m chandelier