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 RESTduino IR code mod
/*
RESTduino
A REST-style interface to the Arduino via the
Wiznet Ethernet shield.
Based on David A. Mellis's "Web Server" ethernet
shield example sketch.
Circuit:
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 http://www.makeuseof.com/
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 outgoing webhook response that doesnt unfurl
{"text":"These posts are still doing well: <http://www.makeuseof.com/tag/control-philips-hue-lights-arduino-and-motion-sensor/> (1392) ... <http://www.makeuseof.com/tag/3-easy-ways-tablet-stand/> (1037) ... <http://www.makeuseof.com/tag/upgrade-ps4s-hard-drive/> (2966) ","unfurl_links": true}
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
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 vagrantup.com.
View gist:8102672
Jamess-iMac:Applications jamie$ ls -R
GitHub.app Vagrantfile Windows 7 Applications.app
./.vagrant/machines:
default
./.vagrant/machines/default:
virtualbox
./.vagrant/machines/default/virtualbox:
@jamesabruce
jamesabruce / Romantic_accessory.js
Created Feb 11, 2016
An accessory for HAP-NodeJS that integrates with Sonos HTTP API server running on localhost
View Romantic_accessory.js
var Accessory = require('../').Accessory;
var Service = require('../').Service;
var Characteristic = require('../').Characteristic;
var uuid = require('../').uuid;
var request = require('request');
// here's a fake hardware device that we'll expose to HomeKit
var FAKELIGHT = {
powerOn: false,
brightness: 100, // percentage
@jamesabruce
jamesabruce / Bedroomplug_accessory.js
Created Feb 12, 2016
A simple HAP-NodeJS accessory for a DIY power socket device
View Bedroomplug_accessory.js
var Accessory = require('../').Accessory;
var Service = require('../').Service;
var Characteristic = require('../').Characteristic;
var uuid = require('../').uuid;
var mqtt = require('mqtt');
var options = {
port: 1883,
host: '192.168.1.99',
clientId: 'Bedroom plug accessory'
};
@jamesabruce
jamesabruce / sonos.js
Created Mar 1, 2016
If-This-Then-Node plugin to send voice notifications to Sonos through Sonos-HTTP-API
View sonos.js
var request = require('request');
module.exports = {
run: function (params, log, callback) {
request('http://localhost:5005/sayall/'+params.message+'/en-gb', function (error, response, body) {
console.log("Sent message \""+params.message+"\" to device "+params.device);
})
callback({
'success': true,
'output': 'all good!'
@jamesabruce
jamesabruce / flora-clutch.ino
Created Mar 10, 2016
Light-Up Clutch Demo of Element14 Flora Arduino Starter Kit
View flora-clutch.ino
// things from the color sensor library
#include
#include "Adafruit_TCS34725.h"
/* Initialise with specific int time and gain values */
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);
// including things from light sensor library
@jamesabruce
jamesabruce / 4wd-robot-test.ino
Created Dec 17, 2015
First program for 4WD Arduino Robot Kit
View 4wd-robot-test.ino
// Motor A pins (enableA = enable motor, pinA1 = forward, pinA2 = backward)
int enableA = 11;
int pinA1 = 6;
int pinA2 = 5;
//Motor B pins (enabledB = enable motor, pinB2 = forward, pinB2 = backward)
int enableB = 10;
int pinB1 = 4;
int pinB2 = 3;
You can’t perform that action at this time.