This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The MySensors Arduino library handles the wireless radio link and protocol | |
* between your home built sensors/actuators and HA controller of choice. | |
* The sensors forms a self healing radio network with optional repeaters. Each | |
* repeater and gateway builds a routing tables in EEPROM which keeps track of the | |
* network topology allowing messages to be routed to nodes. | |
* | |
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org> | |
* Copyright (C) 2013-2015 Sensnology AB | |
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import bluetooth | |
import time | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
RELAY = 23 | |
GPIO.setup(RELAY, GPIO.OUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
NewerOlder