This file contains hidden or 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
// 2010 Kenneth Finnegan | |
// kennethfinnegan.blogspot.com | |
// | |
// Drives cross walk sign in standard cycle | |
// Outputs buffered through 400V TRIACs | |
// Runs on standard ATTiny85 with internal oscillator | |
#include <inttypes.h> | |
#include <avr/io.h> |
This file contains hidden or 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
// 2010 Kenneth Finnegan | |
// kennethfinnegan.blogspot.com | |
// | |
// Serial monitor to print a TTL serial line | |
// to an HD44780 LCD screen | |
// Runs on any Arduino platform | |
#include <LiquidCrystal.h> | |
// initialize the library with the numbers of the interface pins |
This file contains hidden or 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
// 2010 Kenneth Finnegan | |
// http://kennethfinnegan.blogspot.com/ | |
// Ultra-low power LCD counter experiment | |
#include "msp430G2231.h" | |
// Which digit is being displayed | |
volatile unsigned char mode; | |
// refresh periods spent in current mode | |
volatile unsigned char modecnt; |
This file contains hidden or 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
#!/bin/sh | |
# | |
# Kenneth Finnegan, 2010 | |
# kennethfinnegan.blogspot.com | |
# | |
# Counts service requests for the day and adds count to smaller log file | |
# | |
# To have run by cron at 23:59 daily, add the following to your crontab | |
# 59 23 * * * /mnt/storage/lighty/logrotate.sh |
This file contains hidden or 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
#!/bin/sh | |
# Kenneth Finnegan, 2010 | |
# kennethfinnegan.blogspot.com | |
# | |
# status.sh - CGI script to print current Chumby health and statistics | |
# | |
# Install in web server cgi-bin/ folder | |
# Schedule with cron to prevent stale cache: | |
# 0 * * * * /.../cgi-bin/status.sh > /dev/null | |
# |
This file contains hidden or 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
// I2C library using USI hardware support | |
// Kenneth Finnegan, 2010 | |
// kennethfinnegan.blogspot.com | |
// Heavily based on Atmel application note AVR310 | |
#include <util/delay.h> | |
#include <avr/io.h> | |
#include <inttypes.h> | |
//#define PARAM_VERIFY |
This file contains hidden or 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
# Kenneth Finnegan, 2010 | |
# kennethfinnegan.blogspot.com | |
# | |
# AWK patterns to format alternating lines of date and geoip tags into | |
# single lines of date % ipaddr. | |
# | |
# 2010 12 15: Initial revision | |
/^[MTWSF]/ {printf ( "\n%s %% " ,$0)} | |
/.*"US".*"[0-9.]*"/{printf ("%s",$4)} |
This file contains hidden or 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
// Christmas light controller | |
// Drives three TRIAC channels for lights hung on outside of house | |
// Kenneth Finnegan, 2010 | |
// kennethfinnegan.blogspot.com | |
#define ROOFL 12 | |
#define ROOFR 11 | |
#define WINDOW 13 |
This file contains hidden or 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
// Kenneth Finnegan, 2011 - GPLv2 | |
// kennethfinnegan.blogspot.com | |
// Read a single byte from the given address | |
unsigned char EEPROM_read( unsigned int eeprom_addr ) { | |
// Spin-lock until EEPROM finishes prev write | |
while (EECR & (1<<EEPE)) ; | |
// Setup address register | |
EEAR = eeprom_addr; | |
// Start read |
This file contains hidden or 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
// 2010 Kenneth Finnegan | |
// kennethfinnegan.blogspot.com | |
// | |
// Control System for 4 channel lamp system | |
// | |
// Digital outputs are fed into TRIACs to control 120VAC | |
// | |
// Digital inputs come from push buttons and 120VAC light switch | |
// PC[0..3] - Push buttons |