Skip to content

Instantly share code, notes, and snippets.

James Bruce jamesabruce

Block or report user

Report or block jamesabruce

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at
View gist:8102672
Jamess-iMac:Applications jamie$ ls -R Vagrantfile Windows 7
View Arduino Sunrise Alarm Clock and Night Light by James Bruce
* Sunrise Alarm Clock and Night Light by James Bruce
* Initial setup requires you to reset the Arduino sometime in the evening.
* Set the hoursUntilSunrise relative to this time.
* eg, if you reset at 10pm, and want the sunrise to start at 6:30am,
* the value should be 8.5 - this will then be automatically changed to minutes for internal clock to function
View RESTduino IR code mod
A REST-style interface to the Arduino via the
Wiznet Ethernet shield.
Based on David A. Mellis's "Web Server" ethernet
shield example sketch.
View ambilight.ino
// Slightly modified Adalight protocol implementation that uses FastLED
// library ( for driving WS2811/WS2812 led stripe
// Was tested only with Prismatik software from Lightpack project
#include "FastLED.h"
#define NUM_LEDS 114 // Max LED count
#define LED_PIN 6 // arduino output pin
#define GROUND_PIN 10
#define BRIGHTNESS 255 // maximum brightness
View thundercloud_ir_receiver.ino
Qyuick and dirty IR signal over i2c rebroadcast for
Lighting Cloud Mood Lamp By James Bruce
View the full tutorial and build guide at
Used to get around the limitations of having two libraries that both require exact timings to work right!
#include <Wire.h>
#include <IRremote.h>
View thundercloud.ino
Lighting Cloud Mood Lamp By James Bruce
View the full tutorial and build guide at
Sound sampling code originally by Adafruit Industries. Distributed under the BSD license.
This paragraph must be included in any redistribution.
#include <Wire.h>
#include "FastLED.h"
jamesabruce / neomatrix_pixel_display.ino
Created Jan 22, 2015
Sample code for working with the giant LED screen described at, using Adafruit Neomatrix and GFX libraries
View neomatrix_pixel_display.ino
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#define XSIZE 15
#define YSIZE 14
#define PIN 6
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(XSIZE, YSIZE, PIN,
jamesabruce / Philips Hue Candle Effect
Created Apr 4, 2015
High speed, flickering candle bulb effect for any number of Philips Hue bulbs
View Philips Hue Candle Effect
set HUB to "" --change for your bridge IP
set USER to "newdeveloper"
repeat with bulb from 1 to 2 -- Change if you have more bulbs or want to use a subset
set hue to (random number from 5000 to 12750)
set sat to (random number from 150 to 255)
set bri to (random number from 50 to 255)
set transitiontime to (random number from 1 to 3) -- Increase range for slower transitions
set query to "{\"sat\":" & sat & ",\"hue\":" & hue & ",\"bri\":" & bri & ",\"transitiontime\":" & transitiontime & "}"
set command to "curl --request PUT --data '" & query & "' http://" & HUB & "/api/" & USER & "/lights/" & bulb & "/state/ --connect-timeout 5"
jamesabruce / Control Philips Hue from Arduino Ethernet Shield
Created Apr 5, 2015
Example of using an Arduino with Ethernet shield to control Philips Hue, with PIR motion sensor on i/o pin 2.
View Control Philips Hue from Arduino Ethernet Shield
Talking to Hue from an Arduino
By James Bruce (
Adapted from code by Gilson Oguime.
#include <SPI.h>
#include <Ethernet.h>
// Hue constants
You can’t perform that action at this time.