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
/* ripped from http://aquaticus.info/pwm-sine-wave */ | |
uint8_t sine_wave[256] = { | |
0x80, 0x83, 0x86, 0x89, 0x8C, 0x90, 0x93, 0x96, | |
0x99, 0x9C, 0x9F, 0xA2, 0xA5, 0xA8, 0xAB, 0xAE, | |
0xB1, 0xB3, 0xB6, 0xB9, 0xBC, 0xBF, 0xC1, 0xC4, | |
0xC7, 0xC9, 0xCC, 0xCE, 0xD1, 0xD3, 0xD5, 0xD8, | |
0xDA, 0xDC, 0xDE, 0xE0, 0xE2, 0xE4, 0xE6, 0xE8, | |
0xEA, 0xEB, 0xED, 0xEF, 0xF0, 0xF1, 0xF3, 0xF4, | |
0xF5, 0xF6, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC, |
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
DEVICE = attiny85 | |
CLOCK = 1000000 | |
PROGRAMMER = -c usbtiny | |
OBJECTS = main.o | |
FUSES = -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m | |
# generated by http://www.engbedded.com/fusecalc/ | |
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) | |
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) |
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
// based largely on Atmel's AVR136: Low-Jitter Multi-Channel Software PWM Application Note: | |
// http://www.atmel.com/dyn/resources/prod_documents/doc8020.pdf | |
#include <avr/io.h> | |
#include <util/delay.h> | |
#include <avr/interrupt.h> | |
#define CHMAX 3 // maximum number of PWM channels | |
#define PWMDEFAULT 0x00 // default PWM value at start up for all channels |
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
{ | |
"name": "master bedroom", | |
"deviceType": "switch", | |
"onUrl": "http://<<VERA IP ADDRESS>>:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=<<VERA ON SCENE ID>>", | |
"offUrl": "http://<<VERA IP ADDRESS>>/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=<<VERA OFF SCENE ID>>" | |
} |
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
before do | |
# remove and grab the file extension | |
request.path_info.sub! %r{\.([^\./]+)$}, '' | |
@format=$1 || 'html' | |
@charset=mime_type($1) || 'text/html' | |
content_type @charset, :charset => 'utf-8' | |
end |
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
# ---------------------------------------------------------------------------- | |
# Makefile for lcd library | |
# Author: Peter Fleury | |
# File: $Id: Makefile.lcd,v 1.5 2015/01/31 19:59:32 peter Exp $ | |
# | |
# Adjust MCU and F_CPU below to your AVR target | |
# Optionally define -D_LCD_DEFINITIONS_FILE in the CDEFS section below | |
# if you want to use a separate file for display and target specific defines | |
#---------------------------------------------------------------------------- | |
# usage: |
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
// example sketch to demonstrate percieved neopixel library error. | |
// expect green > off(-ish) > blue > off > red > off > green > off(-ish) > blue > off > red | |
// get green > off(-ish) > blue > off > red > off > off > off > blue > off > red | |
#include <Adafruit_NeoPixel.h> | |
#define PIN 0 | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_RGB + NEO_KHZ800); |
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
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
////////////////////////// | |
// DHT sensor stuff.... | |
////////////////////////// | |
#include "DHT.h" |
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
female end of strand is start and is pin-ed like so... | |
/-----------\ | |
| v | | |
| vcc | gnd | | |
| led | clk | | |
\-----------/ |
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
DEVICE = attiny2313 | |
#DEVICE = attiny85 | |
CLOCK = 1000000 | |
PROGRAMMER = -c usbtiny | |
#PROGRAMMER = -c dragon_hvsp -P usb | |
# attiny2313 doesn't like dragon_hvsp setting... | |
#PROGRAMMER = -c dragon_pp -P usb | |
OBJECTS = main.o |
NewerOlder