This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
LED VU meter for Arduino and Adafruit NeoPixel LEDs. | |
Hardware requirements: | |
- Most Arduino or Arduino-compatible boards (ATmega 328P or better). | |
- Adafruit Electret Microphone Amplifier (ID: 1063) | |
- Adafruit Flora RGB Smart Pixels (ID: 1260) | |
OR | |
- Adafruit NeoPixel Digital LED strip (ID: 1138) | |
- Optional: battery for portable use (else power through USB or adapter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local doorState = "open"; | |
local page = "<html>" + | |
"<head></head>" + | |
"<body>" + | |
"<form action='" + http.agenturl() +"' method='post'>" + | |
"<input type='password' autocomplete='on' name='pin' placeholder='pin'></input> <br>" + | |
"<button name='command' value='open' type='submit'>Open</button>" + | |
"<button name='command' value='lock' type='submit'>Lock</button>" + | |
"</form>" + | |
"</body>" + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define REDPIN 3 | |
#define GREENPIN 5 | |
#define BLUEPIN 6 | |
char payload[5] = "100"; | |
unsigned long timeLastCommand; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define REDPIN 3 | |
#define GREENPIN 5 | |
#define BLUEPIN 6 | |
char payload[5] = "100"; | |
unsigned long timeLastCommand; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hardware.pin9.configure(ANALOG_IN); | |
function getTemp() { | |
local supplyVoltage = hardware.voltage(); | |
local voltage = supplyVoltage * hardware.pin9.read() / 65535.0; | |
local c = (voltage - 0.5) * 100 ; | |
local c_str = format("%.01f", c); | |
server.log("Current temp is "+c_str+" °C"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pi@everymote ~ $ ls /dev/serial/by-id/ | |
usb-SparkFun_Electronics_SparkFun_ProMicro5-if00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps: | |
0. Checkout your git repo from the server (I use /var/www/carbonite) | |
1. Upload both of these files to the same directory on your server | |
2. chmod +x restart_node.sh | |
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log & | |
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/ | |
5. Make a commit to your repo | |
6. Point a browser at http://<your host>:8080/ and you should see the commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
VU Meter Pith Helmet code is a modified version of Adafruit LED VU meter for Arduino | |
LED VU meter for Arduino and Adafruit NeoPixel LEDs. | |
Hardware requirements: | |
- Most Arduino or Arduino-compatible boards (ATmega 328P or better). | |
- Adafruit Electret Microphone Amplifier (ID: 1063) | |
- Adafruit Flora RGB Smart Pixels (ID: 1260) | |
OR |