Skip to content

Instantly share code, notes, and snippets.

@evilmachina
evilmachina / VU_earrings.ino
Created August 11, 2014 10:13
Code for neopixel vu earrings
/*
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)
@evilmachina
evilmachina / agent.nut
Created December 8, 2013 17:56
Electric imp door lock. Read more at http://slickstreamer.info
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>" +
#define REDPIN 3
#define GREENPIN 5
#define BLUEPIN 6
char payload[5] = "100";
unsigned long timeLastCommand;
#define REDPIN 3
#define GREENPIN 5
#define BLUEPIN 6
char payload[5] = "100";
unsigned long timeLastCommand;
@evilmachina
evilmachina / TMP36.device.nut
Created September 1, 2013 07:53
Electric Imp TMP36 Thermometer Thingspeak Logger
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");
@evilmachina
evilmachina / Get_file_name.sh
Last active December 18, 2015 07:49
Build your own automated candy machine Part 2 Controlling the servo
pi@everymote ~ $ ls /dev/serial/by-id/
usb-SparkFun_Electronics_SparkFun_ProMicro5-if00
@evilmachina
evilmachina / github_post_commit.js
Created December 2, 2011 20:21 — forked from blindsey/github_post_commit.js
node.js auto deploy scripts
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
@evilmachina
evilmachina / vu_meter_pith_helmet.ino
Created June 12, 2014 15:05
VU Meter Pith Helmet
/*
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