Skip to content

Instantly share code, notes, and snippets.

Avatar

Kenneth Finnegan PhirePhly

View GitHub Profile
View Arduino Game of Life
/*
The Game of Life displayed on an
HD44780 LCD from an Arduino
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers
// of the interface pins
View ATempLogger.c
// 2009 Kenneth Finnegan
// kennethfinnegan.blogspot.com
#include <Wire.h>
#include <LiquidCrystal.h>
//// PINS ////
#define LEDPIN 13
LiquidCrystal lcd(2,3,4,5,6,7);
//// I2C ADDRESSES ////
View RGB_moodlight.c
// 2009 Kenneth Finnegan
// kennethfinnegan.blogspot.com
// Pins. Must be PWM pins.
#define REDLED 9
#define BLUELED 10
#define GREENLED 11
// Can't be higher than 255
#define MAXBRIGHT 200
View clock_led_7segment.c
// 2009 Kenneth Finnegan
// kennethfinnegan.blogspot.com
#include <Wire.h>
// I2C address
#define DS1307 B1101000
// pinout for the 7 segment display
// Starts top center, clock-wise, then
View twinkle.c
#include <avr/io.h> // this contains all the IO port definitions
#include <util/delay.h>
// Global used to store the generated randomness
unsigned int reg=1;
// This function basically wastes time
void delay_ms(long int ms) {
for( ; ms > 0; ms--) {
_delay_ms( 1);
View 4dig7seg.c
// 4 digit 7 segment clock
// 2010 kennethfinnegan.blogspot.com
// http://kennethfinnegan.blogspot.com/2010/01/arduino-four-digit-clock.html
#include <Wire.h>
#define DS1307 B1101000
// LED Driver pins
#define LEDDATA 12
#define LEDCLOCK 11
View LED_binary_clock.c
// 2009 Kenneth Finnegan
// kennethfinnegan.blogspot.com
// http://kennethfinnegan.blogspot.com/2010/01/arduino-binary-clock.html
#include <Wire.h>
#define DS1307 B1101000
#define LEDDATA 7
#define LEDCLOCK 8
#define LEDLATCH 9
View dotmatrix.c
// 2010 Kenneth Finnegan
// Arduino Dot Matrix Clock
// kennethfinnegan.blogspot.com
// http://kennethfinnegan.blogspot.com/2010/02/dot-matrix-arduino-clock.html
// Note: There is commented out code throughout
// that can be uncommented to use a switch on
// pin 13 to toggle the first two columns between
// the date and the current temperature in F read
// from the 10 bit temperature sensor on the DS3232
View USI_I2C.c
// I2C library using USI hardware support
// 2010 Kenneth Finnegan
// Heavily based on Atmel application note AVR310
#include <util/delay.h>
#include <avr/io.h>
#include <inttypes.h>
//#define PARAM_VERIFY
//#define SIGNAL_VERIFY
View bicolorclock.c
// 2010 Kenneth Finnegan
// http://kennethfinnegan.blogspot.com/
// Two color blink clock running on MSP430 controller
#include "msp430G2101.h"
#define BLINK_ON 3000
#define BLINK_OFF 1500
#define BLINK_SPACE 6000