<commit_before>Web controlled LED Strips on a Raspberry Pi
=========================

What is this?
------------------------
This repo contains all the code needed to be able to control your LED strips from a web page served by the Pi, with some minimal tweaking. At some point, screenshots and pictures will be uploaded. While this should work pretty much straight up out of the box, I can't make any guarantees.

Setup and Installation
-------------------------

###0. Requirements:
You'll need your Pi to have some sort of server software (for example Apache) and PHP installed. Here's a quick guide to setting both up: 
http://www.raspberrypi.org/documentation/remote-access/web-server/apache.md

Quick bash line that will install Apache and PHP:

```bash
sudo apt-get install apache2 php5 libapache2-mod-php5 -y
```

###1. Get the Code
Pull the code from the repo using your favourite method. For example, if you have git installed on your Pi:

```bash
cd /var/www/
sudo git clone https://github.com/jimenezl/web-controlled-led-strips.git ledController
```

Run the above commands to pull the code to the default Apache web folder, or get the code some other way.
Make sure it is running by going to http://localhost/ledController/server/ and confirming the controller interface loads.
Playing around with the buttons and sliders should make the values change at http://localhost/ledController/server/displayData.php. If the values at displayData.php don't change, you might have to fiddle around with giving www-data permission:

```bash
sudo chown -R www-data:www-data /var/www/ledController/server/
sudo chmod -R 770 /var/www/ledController/server/
```

###2. Hook up your LED strips

This depends on your setup, but you'll need to choose 3 pins to use as output, one each for red, green, and blue. Pictures will be uploaded at some point in the future.

###3. Modify Python File

Open up the python file at /raspi/ledStripController.py and change the pin numbers on lines 9, 10, and 11 to the corresponding pin numbers used in your setup from step 2. Save and close the file.

###4. Run The Python

Run the python file with your favourite method.
For example:
<commit_msg>added extra instructions to readme<commit_after>Web controlled LED Strips on a Raspberry Pi
=========================

What is this?
------------------------
This repo contains all the code needed to be able to control your LED strips from a web page served by the Pi, with some minimal tweaking. At some point, screenshots and pictures will be uploaded. While this should work pretty much straight up out of the box, I can't make any guarantees.

Setup and Installation
-------------------------

###0. Requirements:
You'll need your Pi to have some sort of server software (for example Apache) and PHP installed. Here's a quick guide to setting both up: 
http://www.raspberrypi.org/documentation/remote-access/web-server/apache.md

Quick bash line that will install Apache and PHP:

```bash
sudo apt-get install apache2 php5 libapache2-mod-php5 -y
```

###1. Get the Code
Pull the code from the repo using your favourite method. For example, if you have git installed on your Pi:

```bash
cd /var/www/
sudo git clone https://github.com/jimenezl/web-controlled-led-strips.git ledController
```

Run the above commands to pull the code to the default Apache web folder, or get the code some other way.
Make sure it is running by going to http://localhost/ledController/server/ and confirming the controller interface loads.
Playing around with the buttons and sliders should make the values change at http://localhost/ledController/server/displayData.php. If the values at displayData.php don't change, you might have to fiddle around with giving www-data permission:

```bash
sudo chown -R www-data:www-data /var/www/ledController/server/
sudo chmod -R 770 /var/www/ledController/server/
```

###2. Hook up your LED strips

This depends on your setup, but you'll need to choose 3 pins to use as output, one each for red, green, and blue. Pictures will be uploaded at some point in the future.

###3. Modify Python File

Open up the python file at /raspi/ledStripController.py and change the pin numbers on lines 9, 10, and 11 to the corresponding pin numbers used in your setup from step 2. 

Change line 13 to point to your server/displayData.php if needed.

Save and close the file. You might need to open it with root priveleges if it complains about not having permissions(ie. 'sudo nano /var/www/ledController/raspi/ledStripController.py')

###4. Run The Python

Run the python file with your favourite method.
For example:

{'fraction_non_alphanumeric': 0.09674620390455531, 'fraction_numerical': 0.008676789587852495, 'mean_word_length': 3.768355739400207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 15, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4451379', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1188, 'n_words': 661}