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
/** | |
* detect mutiple resets in order to trigger events using resets or power cycles alone | |
* reset board within resettimeout(5000ms) after boot and do so resetcnt(4) times | |
* has led indicator of reset window and serial output for better clarity | |
* | |
* This is blocking using a delay for timeout, can easily be changed to use a timer | |
* This is not wear leveled, but you could replace with spiffs(slower), or use a ring counter to level it | |
* You could also add a smaller window for reset by adding a pre-delay, to prevent reduce flash writes during glitchy or fast power cycles | |
* either way USE WITH CAUTION as you are writing twice every time your reset or repower the board, soft resets and wdt should not trigger this however. | |
* |
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
void scrollString(String str) { | |
int yoff = 1; | |
display.clearDisplay(); | |
display.setTextWrap(false); // we don't wrap text so it scrolls nicely | |
display.setTextSize(2); | |
display.setRotation(0); | |
int charWidth = 12; // textsize 2 @todo auto calculate charwidth from font | |
int pxwidth = (str.length()*charWidth)+32; // @todo get actual string pixel length, add support to gfx if needed | |
for (int32_t x=charWidth; x>=-pxwidth; x--) { |
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
/* | |
* This sketch demonstrates how to scan WiFi networks. | |
* The API is almost the same as with the WiFi Shield library, | |
* the most obvious difference being the different file you need to include: | |
*/ | |
#include "ESP8266WiFi.h" | |
void setup() { | |
Serial.begin(115200); | |
// Serial.setDebugOutput(true); |
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
// lib A | |
Global Server; | |
void on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); | |
server->on("/", std::bind(&myClass::handler, this, handlerArg)); | |
void myClass::handler(bool arg){ | |
Server->blargh(); | |
} |
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
Jun 13 06:59:53 tasmota_C59B5E-7006 192.168.20.46 ESP-MQT: tele/tasmota_C59B5E/SENSOR = {"Time":"2021-06-13T06:59:52","ANALOG":{"CTEnergy":{"Energy":0.006,"Power":2068,"Voltage":230,"Current":8.992}},"DHT11":{"Temperature":23.0,"Humidity":37.0,"DewPoint":7.5},"TempUnit":"C"} | |
Jun 13 06:59:53 tasmota_C59B5E-7006 192.168.20.46 ESP-MQT: tele/tasmota_C59B5E/STATE = {"Time":"2021-06-13T06:59:52","Uptime":"0T00:00:11","UptimeSec":11,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"leela","BSSId":"F4:92:BF:7F:35:4B","Channel":3,"RSSI":30,"Signal":-85,"LinkCount":1,"Downtime":"0T00:00:05"}} | |
Jun 13 06:59:51 tasmota_C59B5E-7006 192.168.20.46 ESP-APP: Boot Count 27 | |
Jun 13 06:59:49 tasmota_C59B5E-7006 192.168.20.46 ESP-QPC: Reset | |
Jun 13 06:59:49 tasmota_C59B5E-7006 192.168.20.46 ESP-MQT: stat/tasmota_C59B5E/STATUS10 = {"StatusSNS":{"Time":"2021-06-13T06:59:49","ANALOG":{"CTEnergy":{"Energy":0.004,"Power":2088,"Voltage":230,"Current":9.078}},"DHT11":{"Temperature": |
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
/** | |
* Arduino ESP8266 telnet server with some ansi experiments | |
* @author: shawn_a | |
*/ | |
#include <ESP8266WiFi.h> | |
#include <Arduino.h> | |
/* Set these to your desired AP credentials. */ | |
const char *APssid = "ESPap"; |
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
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3 | |
#include "EmonLib.h" // Include Emon Library | |
#define VOLT_CAL 148.7 | |
EnergyMonitor emon1; // Create an instance | |
void setup() | |
{ |
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
/* | |
* aw9523.c aw9523 martix key | |
* | |
* Version: v1.0.1 | |
* | |
* Copyright (c) 2017 AWINIC Technology CO., LTD | |
* | |
* Author: Nick Li <liweilei@awinic.com.cn> | |
* | |
* This program is free software; you can redistribute it and/or modify it |
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
//COMPILES | |
#ifndef SOMEDEF | |
void initstuff(){ | |
} | |
#endif | |
#ifdef SOMEDEF | |
void initstuff(){ | |
} | |
#endif |
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
// typedef enum { | |
// WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */ | |
// WIFI_COUNTRY_POLICY_MANUAL, /**< Country policy is manual, always use the configured country info */ | |
// } WIFI_COUNTRY_POLICY; | |
// typedef struct { | |
// char cc[3]; /**< country code string */ | |
// uint8_t schan; /**< start channel */ | |
// uint8_t nchan; /**< total channel number */ | |
// uint8_t policy; /**< country policy */ |
NewerOlder