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
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
#include <time.h> | |
const char* ssid = "co2_sensor"; | |
const char* password = "1qazxsw2"; | |
ESP8266WebServer server(80); |
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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <DHT.h> | |
DHT dht(D5, DHT22); | |
const char* ssid = "........"; | |
const char* password = "........"; | |
IPAddress mqttServer(192, 168, 1, 10); |
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
#include <functional> | |
void setup() { | |
Serial.begin(115200); | |
delay(1000); | |
Serial.println(""); | |
Serial.println("start"); | |
} | |
uint32_t measure_time(std::function<void(void)> fn) |
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
#include <Arduino.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266HTTPClient.h> | |
uint8_t buff[128] = { 0 }; | |
void setup() { | |
WiFi.mode(WIFI_STA); | |
WiFi.begin("#!/bin/test", "test_bin"); | |
Serial.begin(115200); |
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
#include <ESP8266WiFi.h> | |
#include <FS.h> | |
#include <ESP8266WebServer.h> | |
void startSoftAP() { | |
Serial.println("startSoftAP"); | |
WiFi.mode(WIFI_AP); | |
WiFi.softAP("ESPAP"); | |
ESP8266WebServer server; |
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
// Download SMTPClient library from https://github.com/gregington/SMTPClient | |
#include <ESP8266WiFi.h> | |
#include <Client.h> | |
#include <Mail.h> | |
#include <SMTPClient.h> | |
WiFiClient wifiClient; | |
SmtpClient client(&wifiClient, "smtp.163.com"); |
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
git clone https://github.com/espressif/newlib-esp32.git && | |
cd newlib-esp32 && \ | |
./configure \ | |
--with-newlib \ | |
--enable-multilib \ | |
--disable-newlib-io-c99-formats \ | |
--disable-newlib-supplied-syscalls \ | |
--enable-newlib-nano-formatted-io \ | |
--enable-newlib-reent-small \ | |
--enable-target-optspace \ |
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
#!/bin/bash | |
# Runs astyle with the full set of formatting options | |
astyle \ | |
--style=otbs \ | |
--indent=spaces=4 \ | |
--convert-tabs \ | |
--align-pointer=name \ | |
--align-reference=name \ | |
--keep-one-line-statements \ | |
--pad-header \ |
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
SRC := dcmi_source.v | |
CONSTRAINTS := dcmi_source.pcf | |
NAME := dcmi_source | |
TOP := DCMISource | |
all: $(NAME).bin | |
$(NAME).blif: $(SRC) | |
yosys -p 'synth_ice40 -top $(TOP) -blif $@' $< |
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 sample illustrates how to go back to deep sleep from the | |
* deep sleep wake stub. | |
* | |
* Consider the use case of counting pulses from an external sensor, | |
* where the pulses arrive at a relatively slow rate. | |
* | |
* ESP32 is configured to go into deep sleep mode, and wake up from | |
* a GPIO pin connected to the external pulse source. | |
* Once the pulse arrives, ESP32 wakes up from deep sleep and runs |