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 ambilight.ino
// Slightly modified Adalight protocol implementation that uses FastLED
// library (http://fastled.io) 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
@jamesabruce
jamesabruce / neomatrix_pixel_display.ino
Created Jan 22, 2015
Sample code for working with the giant LED screen described at MakeUseOf.com, 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,
NEO_MATRIX_BOTTOM + NEO_MATRIX_LEFT +
@jamesabruce
jamesabruce / ESP_RELAY_MQTT.ino
Created Feb 12, 2016
Simple MQTT controlled relay running on NodeMCU dev board on pin d2/gpio4
View ESP_RELAY_MQTT.ino
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <PubSubClient.h>
#define RELAY 4 // pin labelled d2
// Update these with values suitable for your network.
const char* ssid = "YOURWIFI";
View MQTT publishing DHT11 sensor on Arduino
/*
Basic MQTT example
*/
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
// Our first sensor, a cheap DHT11 temperature and humidty sensor
#include <DHT.h>
@jamesabruce
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 (MakeUseOf.com)
Adapted from code by Gilson Oguime. https://github.com/oguime/Hue_W5100_HT6P20B/blob/master/Hue_W5100_HT6P20B.ino
*/
#include <SPI.h>
#include <Ethernet.h>
// Hue constants
@jamesabruce
jamesabruce / robot_with_ping.ino
Created Dec 19, 2015
Beginner Robot with Ping Sensor
View robot_with_ping.ino
#include <NewPing.h>
//Tell the Arduino where the sensor is hooked up
NewPing sonar(12, 13);
int enableA = 11;
int pinA1 = 6;
int pinA2 = 5;
int enableB = 10;
@jamesabruce
jamesabruce / Officelight_accessory.js
Last active Sep 5, 2018
HAB-NodeJS accessory for MakeUseOf Wi-Fi light tutorial
View Officelight_accessory.js
// MQTT Setup
var mqtt = require('mqtt');
console.log("Connecting to MQTT broker...");
var mqtt = require('mqtt');
var options = {
port: 1883,
host: '192.168.1.99',
clientId: 'MakeUseOf Wifi Light'
};
var client = mqtt.connect(options);
View Arduino Sunrise Alarm Clock and Night Light by James Bruce
/*
* Sunrise Alarm Clock and Night Light by James Bruce
* http://duinobits.com
* 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
*
*/
@jamesabruce
jamesabruce / lock.py
Created Jul 14, 2015
DIY Proximity Lock v.01
View lock.py
#!/usr/bin/python
import bluetooth
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
RELAY = 23
GPIO.setup(RELAY, GPIO.OUT)
@jamesabruce
jamesabruce / NodeMCU-MQTT-Siri-Wifi-Light.ino
Created Jan 29, 2016
Wi-Fi Neopixel light controlled over MQTT, to be connected through HAP-NodeJS to Siri
View NodeMCU-MQTT-Siri-Wifi-Light.ino
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <PubSubClient.h>
#include <Adafruit_NeoPixel.h>
#define PIN 4
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800);
You can’t perform that action at this time.