Skip to content

Instantly share code, notes, and snippets.

View jonathanhculver's full-sized avatar

Jon Culver jonathanhculver

View GitHub Profile
@jonathanhculver
jonathanhculver / checkmail.ino
Created December 14, 2012 01:56
Arduino code to display a different color LED based on what number it's given.
int incoming = 0;
int REDPin = 4; // RED pin
int GREENPin = 5; // GREEN pin
int BLUEPin = 6; // BLUE pin
void setup() {
// setup serial and led pins
Serial.begin(9600);
pinMode(REDPin, OUTPUT);
pinMode(GREENPin, OUTPUT);
@jonathanhculver
jonathanhculver / checkmail.py
Created December 14, 2012 02:02
Python script to check gmail for new email every minute and send to Arduino over serial.
import imaplib, serial, struct, time
class Mail():
def __init__(self):
self.user= 'USER'
self.password= 'PASS'
self.ser = serial.Serial('/dev/tty.usbmodem621', 9600)
self.M = imaplib.IMAP4_SSL('imap.gmail.com', '993')
self.M.login(self.user, self.password)
@jonathanhculver
jonathanhculver / tail.ino
Last active December 10, 2015 01:18
Tail effect for hacked Christmas lights
/*
G35: An Arduino library for GE Color Effects G-35 holiday lights.
Copyright © 2011 The G35 Authors. Use, modification, and distribution are
subject to the BSD license as described in the accompanying LICENSE file.
*/
#include <G35String.h>
#define LIGHT_COUNT (25)
#define G35_PIN (13)
@jonathanhculver
jonathanhculver / collision.ino
Last active December 10, 2015 01:18
Collision effect for hacked Christmas lights
/*
G35: An Arduino library for GE Color Effects G-35 holiday lights.
Copyright © 2011 The G35 Authors. Use, modification, and distribution are
subject to the BSD license as described in the accompanying LICENSE file.
*/
#include <G35String.h>
#define LIGHT_COUNT (25)
#define G35_PIN (13)
@jonathanhculver
jonathanhculver / lights.ino
Created December 26, 2012 03:54
Christmas lights flashing to trumpet part of All Of The Lights
/*
G35: An Arduino library for GE Color Effects G-35 holiday lights.
Copyright © 2011 The G35 Authors. Use, modification, and distribution are
subject to the BSD license as described in the accompanying LICENSE file.
*/
#include <G35String.h>
#define LIGHT_COUNT (25)
#define G35_PIN (13)
@jonathanhculver
jonathanhculver / rgbBlink.ino
Created December 26, 2012 05:36
Simple blink for RGB LED
@jonathanhculver
jonathanhculver / blink.ino
Created December 26, 2012 05:37
Sample Blink from Arduino examples
@jonathanhculver
jonathanhculver / callscreen.js
Created March 26, 2013 01:29
A call screener app
/* https://github.com/tropo/tropo-webapi-node */
var tropowebapi = require('tropo-webapi');
/* Express framwork http://expressjs.com */
var express = require('express');
/* http://mongoosejs.com/ */
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/track');
mongoose.connect(URI);
//connect to mongodb
@jonathanhculver
jonathanhculver / voteinflator.rb
Created May 13, 2013 02:11
Ruby app code for vote inflator
require 'rubygems'
require 'sinatra'
require 'haml'
require 'tropo-webapi-ruby'
require 'net/http'
set :public_folder, 'public'
tropoToken = ""
#phone numbers to send messages from
fromArray = ['9999999999','9999999999', '9999999999']
@jonathanhculver
jonathanhculver / processing.ino
Created June 24, 2013 03:19
arduino web server processing input
while (client.connected()) {
if (client.available()) {
if(finder.find("GET /")) {
while(finder.findUntil("led", "\n\r")) {
char type = client.read();
int val = finder.getValue();
lightStatus = changeLight(val);
}
}
//pass a simple http response to the browser