Skip to content

Instantly share code, notes, and snippets.

View thomasvt1's full-sized avatar

Thomas van Tilburg thomasvt1

View GitHub Profile
// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"
RTC_DS3231 rtc;
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup () {
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
#include "wpa2_enterprise.h"
}
// SSID to connect to
static const char* ssid = "eduroam";
// Username for authentification
@thomasvt1
thomasvt1 / MQTT_ESP8266_temperature_humidity.ino
Created October 12, 2016 17:18 — forked from balloob/MQTT_ESP8266_temperature_humidity.ino
Sketch for the ESP8266 to publish temperature and humidity values received from a DHT22 to MQTT
// Get ESP8266 going with Arduino IDE
// - https://github.com/esp8266/Arduino#installing-with-boards-manager
// Required libraries (sketch -> include library -> manage libraries)
// - PubSubClient by Nick ‘O Leary
// - DHT sensor library by Adafruit
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <DHT.h>