Skip to content

Instantly share code, notes, and snippets.

@glyons
glyons / datalogger.ino
Last active August 10, 2023 05:59
ESP 8266 Data Logger for Temperature and Humidity using DHT 11
//https://iotprojectsideas.com/esp8266-data-logger-upload-data-on-webserver/
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include "DHT.h"
#ifndef STASSID
#define STASSID "Wifi_Name"
npm start - local server
To build for production, i.e. Docker
npm run build:prod
docker build -t vizbox .
Angular CLI
#include "DigiKeyboard.h"
int led =1 ;
int sensorValue = 0;
int previousvalue=0;
void setup() {
// Just a example
}
void loop() {
int led =1 ;
int sensorValue = 5;
int status = false;
void setup() {
digitalWrite(led, true);
pinMode(led, OUTPUT);
}
void loop() {
Install Nodes.Js
https://nodejs.org/en/download/
Next do Angular Tutorial
https://angular.io/tutorial
From the command Line
=======================
npm install -g electron // Globally
// Display
#include <Adafruit_GFX.h> // Needs a little change in original Adafruit library (See README.txt file)
#include <SPI.h> // For SPI comm (needed for not getting compile error)
#include <Wire.h> // For I2C comm, but needed for not getting compile error
// LED Matrix
#include <Max72xxPanel.h>
// Add Encoder Support
// Display
#include <ESP_SSD1306.h> // Modification of Adafruit_SSD1306 for ESP8266 compatibility
#include <Adafruit_GFX.h> // Needs a little change in original Adafruit library (See README.txt file)
#include <SPI.h> // For SPI comm (needed for not getting compile error)
#include <Wire.h> // For I2C comm, but needed for not getting compile error
// Add Encoder Support
#include <Encoder.h>
// Display
#include <ESP_SSD1306.h> // Modification of Adafruit_SSD1306 for ESP8266 compatibility
#include <Adafruit_GFX.h> // Needs a little change in original Adafruit library (See README.txt file)
#include <SPI.h> // For SPI comm (needed for not getting compile error)
#include <Wire.h> // For I2C comm, but needed for not getting compile error
// Add Encoder Support
#include <Encoder.h>
@glyons
glyons / digitsparkdelayled
Created February 1, 2019 18:21
Digispark 1 second delay button with on board LED
int led =1 ; // Ues on board LED
int button=2; // Button to 5V Rail and 10k register on P2 to GND
int status = false;
void setup() {
digitalWrite(led, LOW);
pinMode(led, OUTPUT);
digitalWrite(button,LOW);
pinMode(button,INPUT);
// mapping suggestion from Waveshare SPI e-Paper to Wemos D1 mini
// BUSY -> D2, RST -> D4, DC -> D3, CS -> D8, CLK -> D5, DIN -> D7, GND -> GND, 3.3V -> 3.3V
#include <GxEPD.h>
// select the display class to use, only one
#include <GxGDEW0154Z04/GxGDEW0154Z04.cpp> // 1.54" b/w/r 200x200
#include GxEPD_BitmapExamples
// FreeFonts from Adafruit_GFX