Skip to content

Commit

Permalink
Add README.md and make general cleaning before make it public
Browse files Browse the repository at this point in the history
  • Loading branch information
akotwica committed Jan 26, 2021
1 parent 53406d3 commit dc5cfc6
Show file tree
Hide file tree
Showing 9 changed files with 721 additions and 57 deletions.
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

Empty file removed LICENSE
Empty file.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Artistic installation project "Chandelier"
## Main idea
We wanted to create interactive sequence about schizophrenia related topics.
#### It is made made from:
- 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

#### Main steps of sequence are:
1. White, pulsing light, ambient sounds from bt speaker - waiting for movement
2. Movement - telephone ring bell from bt speaker, red light, waiting for button push
3. After button push - psychodelic voice from jack speaker, red pulsing light, waiting for another button push
4. 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
5. Break between sequences, ambient sounds from bt speaker, white pulsing lights
6. Repeat


## Main problems:
1. Not commented, messy code. It was written by one person in quite limited amount of time. But it recoverable messy in case that we will continue our project.
2. Bluetooth button - one hell ride with it - this technology it's not meant to be used on "wait long for input" mode. Remote is get constantly disconnected. This is main of reason why main program is looks like it looks.
In next iteration we surely switch for cable-connected button and maybe speaker too.
3. 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.
4. It was my playground for learning how to write someting asynchronized and multi-threaded.
5. 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.
## Main features
1. 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.
2. Get pulse-audio sink from bluetooth speaker to later use it.
3. Asynchronized waiting for bt button push.
4. Managing pulse-audio sinks, possibility to create combined one.
5. Control rgb led light using MOSFET transistor. We had only two because we wanted either only red or white light.
6. Asynchronized waiting for movment detection.

## Usage
1. Install VLC
2. `pip install -r requirments.txt`
3. From main directory: `pip install .`
4. `python[3] -m chandelier`
Binary file removed axel.mp3
Binary file not shown.
4 changes: 0 additions & 4 deletions chandelier/chandelier_parameters.json

This file was deleted.

Empty file removed chandelier/test/__init__.py
Empty file.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setuptools
52 changes: 0 additions & 52 deletions script.sh

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"Operating System :: Raspbian Buster",
],
packages=setuptools.find_packages(), #same as name
install_requires=['retry', 'RPi.GPIO', 'pydub', 'evdev'], #external packages as dependencies
install_requires=['retry', 'RPi.GPIO', 'pydub', 'evdev', 'asyncio', 'pexpect', 'pulsectl', 'python-vlc'], #external packages as dependencies
python_requires='>=3.7',
)

0 comments on commit dc5cfc6

Please sign in to comment.