This file contains hidden or 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 <stdio.h> | |
#include <stdarg.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main(int argc, char *argv[]){ | |
FILE * fp; | |
char *buffer; | |
long flen; | |
char *fname; |
This file contains hidden or 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 <ESP8266mDNS.h> | |
#include <ArduinoOTA.h> | |
#include <FS.h> | |
#include <ESPAsyncTCP.h> | |
#include <ESPAsyncWebServer.h> | |
#include "SPI.h" | |
#include "SD.h" |
This file contains hidden or 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
#save as /etc/chatscripts/sim900 | |
ABORT "BUSY" | |
ABORT "VOICE" | |
ABORT "NO CARRIER" | |
ABORT "NO DIALTONE" | |
ABORT "NO DIAL TONE" | |
ABORT "NO ANSWER" | |
ABORT "DELAYED" | |
REPORT "CONNECT" | |
TIMEOUT 6 |
This file contains hidden or 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
TARGET ?= $(notdir $(shell pwd)) | |
PYTHON ?= python | |
HOME_DIR ?= $(shell echo ~) | |
ARDUINO_DIR ?= $(HOME_DIR)/arduino-1.6.8 | |
ARDUINO_HARDWARE ?= $(ARDUINO_DIR)/hardware | |
ARDUINO_BUILDER ?= $(ARDUINO_DIR)/arduino-builder | |
ARDUINO_TOOLS ?= $(ARDUINO_DIR)/tools-builder | |
ARDUINO_LIBS ?= $(ARDUINO_DIR)/libraries | |
SKETCHBOOK_DIR ?= $(HOME_DIR)/Arduino |
This file contains hidden or 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
#define TRIAC_PIN 5 | |
#define ZERO_CROSS_PIN 4 | |
#define DEBOUNCE_TIME 9000 //9ms - 10ms is the pulse period | |
static uint32_t lastPulse = 0; | |
static uint16_t period = 5000; //5ms - 50% for each half wave | |
void ICACHE_RAM_ATTR onTimerISR(){ | |
if(GPIP(TRIAC_PIN)){//OUTPUT is HIGH | |
GPOC = (1 << TRIAC_PIN);//low |
This file contains hidden or 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
class SPIFFSEditor: public AsyncWebHandler { | |
private: | |
String _username; | |
String _password; | |
bool _uploadAuthenticated; | |
uint32_t _startTime; | |
public: | |
SPIFFSEditor(String username=String(), String password=String()):_username(username),_password(password),_uploadAuthenticated(false),_startTime(0){} | |
bool canHandle(AsyncWebServerRequest *request){ | |
if(request->method() == HTTP_GET && request->url() == "/edit" && (SPIFFS.exists("/edit.htm") || SPIFFS.exists("/edit.htm.gz"))) |
This file contains hidden or 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 "ESPAsyncWebServer.h" | |
#include "SPI.h" | |
#include "SD.h" | |
class AsyncSDFileResponse: public AsyncAbstractResponse { | |
private: | |
sd::File _content; | |
String _path; | |
void _setContentType(String path){ | |
if (path.endsWith(".html")) _contentType = "text/html"; |
This file contains hidden or 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
/* | |
ffmpeg -i "$file" -f s32be -acodec pcm_s32be -ar 44100 -af "volume=0.5" tcp://espip:5522 | |
*/ | |
#include "i2s.h" | |
#include <ESP8266WiFi.h> | |
const char* ssid = "***********"; | |
const char* password = "**********"; | |
WiFiServer pcmServer(5522); | |
static WiFiClient pcmClient; |
This file contains hidden or 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
extern "C" { | |
enum sleep_type { | |
NONE_SLEEP_T = 0, | |
LIGHT_SLEEP_T, | |
MODEM_SLEEP_T | |
}; | |
bool wifi_set_sleep_type(enum sleep_type type); | |
void system_set_os_print(uint8 onoff); | |
void ets_install_putc1(void* routine); | |
} |
NewerOlder