![]() |
|||
For this DIY project, we will be creating a dance sensor that can be hooked to a computer. If you have a rasberry pi The project is basically a sensor that is hooked to a shoe, when you dance, it will twitter a status update stating that you're dancing and play a short sound. |
|||
| STEP 1 - Get your shit together | |||
|
|||
| STEP 2 - Connect | |||
| Hook up a circuit according to this schematic, PIN 13 and its LED is not mandatory. Both the VCC, GND and PIN 2 are from the Arduino. | |||
![]() when hooked up and done, it should look as such
|
|||
| STEP 3 - get a twitter account | |||
| You not only need a twitter |
|||
|
Retrieve from the application settings, the following API codes: |
|||
| STEP 4 - Programming | |||
Replace your API codes with the ones in this Python code and save this code to a text file named "instadance.py" |
|||
|
|||
| STEP 5 - Getting a sound | |||
| You need an unformatted wav file, download the following bell.wav (14K) and place it in the same folder as "instadance.py". |
|||
| STEP 6 - Install Libraries | |||
For the code to work, you need to install two libraries, one for the twitter API and one for the serial port. The twitter API library installation guide |
|||
| Download python-twitter-0.8.2.tar.gz (62.2 Kb) | |||
| or use this QR-code to scan and download the file | |||
Extract the content of the file to a folder, direct a terminal to it and type in the following command: you@computer:~$ python setup.py install For the twitter API itself to work, you have three other dependencies. Visist and install the following three libraries. |
|||
The serial port library installation guide Download pyserial-2.6.tar.gz (113 Kb) Extract the content of the file to a folder, direct a terminal to it and type in the following command: you@computer:~$ python setup.py install |
|||
| STEP 7 - Arduino | |||
| Connect your Arduino to your laptop or pc running GNU/Linux and upload the following code to the device | |||
|
|||
| STEP 8 - The Shoe | |||
| Attach the push button to a shoe, this can be done differently depending the type of push button you are using and the amount of love you have for your shoes. | |||
![]() |
|||
| STEP 9 - Try it out | |||
To understand what the pattern for dancing is you need to try it out. Make sure to have the arduino connected to your computer with the USB cord. Run the "instadance.py" code by directing your terminal to the file and typing the following you@computer:~$ python instadance.py | |||
| Here are the following test-data we recieved | |||
| 6.98184 7.173643 8.15385 8.241606 9.165586 9.23362 10.205625 10.276241 11.249569 11.317582 12.229567 12.297611 13.169597 13.249615 14.141594 14.209798 15.1536 15.213615 16.085618 16.153569 17.033597 17.105527 17.997402 18.057402 18.977585 |
![]() |
||
| 1.008517 1.068062 1.340072 1.400025 1.680034 1.740081 1.980035 2.032051 2.323795 2.36135 2.632031 2.683898 2.952042 3.004751 3.283833 3.333152 3.604032 3.644022 3.924005 3.964415 4.253245 4.304062 4.584036 4.624146 4.909567 |
![]() |
||
| 0.258927 0.326955 0.710992 0.772081 1.44266 1.490909 1.818936 1.872711 2.270864 2.331092 3.043039 3.08289 3.414647 3.442887 3.794751 3.834866 4.543797 4.586889 4.903928 4.946783 5.288098 5.335065 5.966894 5.995035 6.327148 |
![]() |
||
| STEP 10 - Choose a dance | |||
| The python code provided is just 50 steps / 30s, you need to choose a dance-style and modify the code with an algorithm that recognizes the pattern. When that is done you're good to go. | |||
| HERE'S OUR DANCE UPDATER | |||
| Tweets by @adsa | |||