Skip to content

Instantly share code, notes, and snippets.

@nzben
nzben / main.ino
Created Apr 6, 2017
Code for Homie multisensor using TSL2561 luminosity and BME280 triple sensors.
View main.ino
#include <Homie.h>
#include <SparkFunTSL2561.h>
#include <BME280I2C.h>
#include <Wire.h>
#include <SPI.h>
SFE_TSL2561 light;
BME280I2C bme;
boolean gain; // Gain setting, 0 = X1, 1 = X16;
View mqtt data
homie/multi-sensor-1/$homie 2.0.0
homie/multi-sensor-1/$implementation esp8266
homie/multi-sensor-1/$implementation/version 2.0.0
homie/multi-sensor-1/$implementation/ota/enabled true
homie/multi-sensor-1/lux/$type lux
homie/multi-sensor-1/lux/$properties unit,lux
homie/multi-sensor-1/lux/unit lux
homie/multi-sensor-1/lux/lux 0.88
homie/multi-sensor-1/temperature/$type degrees
homie/multi-sensor-1/temperature/$properties unit,degrees
View tempsensor.yaml
platform: mqtt
state_topic: "some/random/topic/temperature"
name: "Some Random Temperature Sensor"
unit_of_measurement: "°C"
View docker-compose.yml
mqtt:
image: eclipse-mosquitto:latest
restart: always
ports:
- "1883:1883"
- "9001:9001"
volumes:
- /opt/conf/mqtt/config:/mosquitto/config
- /opt/conf/mqtt/data:/mosquitto/data
- /opt/conf/mqtt/log:/mosquitto/log
View main.cpp
#include "Arduino.h"
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2561_U.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
View keybase.md

Keybase proof

I hereby claim:

  • I am nzben on github.
  • I am nzben (https://keybase.io/nzben) on keybase.
  • I have a public key ASCPHYisg8eC8r5Hzq2iQefN3J4bFeCqdEjnBAHYEW6m_Qo

To claim this, I am signing this object:

View gist:b645eb7b90e8db6eb34b
### Keybase proof
I hereby claim:
* I am nzben on github.
* I am nzben (https://keybase.io/nzben) on keybase.
* I have a public key whose fingerprint is FAB8 6916 3676 2FCB AB0B 9CED BD03 B3AD C4E8 BF63
To claim this, I am signing this object:
View gist:3e69f2ebdb276c349e43
function() {
var a = "Does slack do nice things with gists?";
}
@nzben
nzben / dkarzon
Created Aug 7, 2013
Dkarzon is like a secret ninja spellchecker.
View dkarzon
-- Local tile udpating
+- Local tile updating