Skip to content

Instantly share code, notes, and snippets.

View me-no-dev's full-sized avatar
🎯
Focusing

Me No Dev me-no-dev

🎯
Focusing
View GitHub Profile
#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;
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <FS.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include "SPI.h"
#include "SD.h"
@me-no-dev
me-no-dev / SIM900_Chatscript
Created March 15, 2016 08:00
PPP connection settings for Linux and SIM900
#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
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
#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
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")))
#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";
/*
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;
@me-no-dev
me-no-dev / AsyncTelnetServer.ino
Last active May 29, 2017 00:20
Single Client Telnet Server example
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);
}