Skip to content

Instantly share code, notes, and snippets.

@RudyFiero
RudyFiero / resetaction.ino
Created July 17, 2017 12:56 — forked from tablatronix/resetaction.ino
example to use eeprom to store reset states to trigger an action on purposeful resets
/**
* 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.
*
@RudyFiero
RudyFiero / firstMesh
Last active February 1, 2017 12:31
Modified startHere.ino
//************************************************************
// this is a simple example that uses the easyMesh library
//
// 1. blinks led once for every node on the mesh
// 2. blink cycle repeats every BLINK_PERIOD
// 3. sends a silly message to every node on the mesh at a random time betweew 1 and 5 seconds
// 4. prints anything it recieves to Serial.print
//
//
//************************************************************
@RudyFiero
RudyFiero / ESPWebSock.ino
Created July 24, 2016 23:55 — forked from bbx10/ESPWebSock.ino
ESP8266 Web server with Web Socket to control an LED
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web