View POVwriter.ino
// how long each led stays on for | |
int delayTime = 1; | |
//how long between each | |
int charBreak = 3; | |
//how long to wait after the message is finished before it repeats | |
int resetTime = 20; | |
int LED1 = 2; | |
int LED2 = 3; | |
int LED3 = 4; |
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 |
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!' |
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 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' | |
}; |
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 |
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 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); |
View newping_demo.ino
#include <NewPing.h> | |
//Tell the Arduino where the sensor is hooked up | |
NewPing sonar(12, 13); | |
long inches; | |
void setup() { | |
//Activate the serial monitor so you can see the output of the sensor | |
Serial.begin(9600); |
NewerOlder