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
// pin is 2. | |
const int multiButton = 2; | |
void setup() { | |
// Configure the pin mode as an input. | |
pinMode(multiButton, INPUT); | |
// Attach an interrupt to the pin, assign the onChange function as a handler and trigger on changes (LOW or HIGH). | |
attachInterrupt(multiButton, onChange, CHANGE); | |
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
//nodeMCU v1.0 (black) with Arduino IDE | |
//stream temperature data DS18B20 with 1wire on ESP8266 ESP12-E (nodeMCU v1.0) | |
//shin-ajaran.blogspot.com | |
//nodemcu pinout https://github.com/esp8266/Arduino/issues/584 | |
#include <ESP8266WiFi.h> | |
#include <OneWire.h> | |
#include <DallasTemperature.h> | |
//Def | |
#define myPeriodic 15 //in sec | Thingspeak pub is 15sec |
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 <Wire.h> | |
#include <PubSubClient.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_BME280.h> | |
#define wifi_ssid "YOUR_WIFI_SSID" | |
#define wifi_password "YOUR_WIFI_PASSWORD" | |
#define mqtt_server "YOUR_MQTT_SERVER_HOST" |
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
// 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> |
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
struct WiFiCredential{ | |
const char *ssid; | |
const char *pass; | |
}; | |
bool wifiConnect() | |
{ | |
if(isWifiConnected()) | |
return true; | |
WiFi.mode(WIFI_STA); |
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
/* | |
dustSensorDemo.ino | |
Copyright (c) 2018 ItKindaWorks All right reserved. | |
github.com/ItKindaWorks | |
dustSensorDemo.ino is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |