Skip to content

Instantly share code, notes, and snippets.

View SoundGuy's full-sized avatar

Oded Sharon SoundGuy

  • Corbomite Games
  • Tel-aviv, Israel
View GitHub Profile
@benwwchen
benwwchen / LEDStripAndSensor.c
Created November 8, 2016 17:11
NodeMCU Arduino Wi-Fi LED Strip and DHT Sensor
#include <ESP8266WiFi.h>
#include <MQTTClient.h>
#include <Adafruit_NeoPixel.h>
#include <DHT.h>
#define STRIP_PIN 4
#define DHT_TYPE DHT11 // DHT11 or DHT22
#define DHT_PIN 2
// Parameter 1 = number of pixels in strip
@benwwchen
benwwchen / LEDStripWithFading.c
Created November 8, 2016 17:10
NodeMCU Arduino Wi-Fi LED Strip
#include <ESP8266WiFi.h>
#include <MQTTClient.h>
#include <Adafruit_NeoPixel.h>
#define STRIP_PIN 4
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
@benwwchen
benwwchen / Sensor_accessory.js
Created November 8, 2016 17:08
HAP-NodeJS MQTT Temperature and Humidity Sensor
var Accessory = require('../').Accessory;
var Service = require('../').Service;
var Characteristic = require('../').Characteristic;
var uuid = require('../').uuid;
var SENSOR = {
currentTemperature: 25,
currentHumidity: 50,
getTemperature: function() {
console.log("Getting the current temperature!");