Skip to content

Instantly share code, notes, and snippets.

View srmq's full-sized avatar

Sergio Queiroz srmq

View GitHub Profile
/*
Blinking LEDs
Turns some LEDs on for one second, then off for one second, repeatedly.
This example code is in the public domain.
Inspired by
http://www.arduino.cc/en/Tutorial/Blink
*/
@srmq
srmq / ArduinoISP
Created January 16, 2020 14:12
ArduinoISP Sketch
// ArduinoISP
// Copyright (c) 2008-2011 Randall Bohn
// If you require a license, see
// http://www.opensource.org/licenses/bsd-license.php
//
// This sketch turns the Arduino into a AVRISP using the following Arduino pins:
//
// Pin 10 is used to reset the target microcontroller.
//
// By default, the hardware SPI pins MISO, MOSI and SCK are used to communicate
@srmq
srmq / WiFiTask.cpp
Last active December 1, 2019 18:34
WiFiTask for Medium's article on cooperative multitasking in the ESP8266
#include "WiFiTask.h"
#include "FS.h"
#include "CloudTask.h"
#include <cstring>
static const char WIFINETS_JSON_FILE[] PROGMEM = "/conf/wifinets.json";
WiFiTask::WiFiTask() : Task(), lastCheck(TimeKeeper::tkNow()), firstRun(true) {
}
@srmq
srmq / IIRR.cpp
Created December 1, 2019 17:48
Main file of the Intelligent Irrigator, available under the GPL v3+
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <cmath>
#include "sensor_calibration.h"
#include "SensorTask.h"
#include "ServerTask.h"
#include "CloudTask.h"
#include "WiFiTask.h"