This piece of code is usable when you need Stream object which has to store/load data to/from Arduino String object.
#ifndef _STRING_STREAM_H_
#define _STRING_STREAM_H_
#include <Stream.h>| # Google DNS | |
| 8.8.8.8 | |
| 8.8.4.4 | |
| # CloudFlare DNS | |
| 1.1.1.1 | |
| # Quad 9 DNS | |
| 9.9.9.9 |
Here is delay-like function for Low-Power Arduino library. All delay measurments are performed with ATMega328pu (8MHz internal, 3.3V).
powerDownDelay(60000) = 60002.256mspowerDownDelay(30000) = 30001.9615mspowerDownDelay(15000) = 15001.783mspowerDownDelay(10000) = 10000.08mspowerDownDelay(5000) = 5000.3095mspowerDownDelay(2000) = 2007.191ms| #include <ESP8266WiFi.h> | |
| #include <PubSubClient.h> | |
| #include <DHT.h> | |
| #include <ArduinoJson.h> | |
| #include <RCSwitch.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <ESP8266httpUpdate.h> | |
| #include <Ticker.h> | |
| // WiFi config |
I hereby claim:
To claim this, I am signing this object:
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.13.0' | |
| } | |
| } | |
| apply plugin: 'com.android.application' |
| protected static Date parseJsonDate(String date) { | |
| Pattern DATE_PATTERN = Pattern.compile("/Date\\((-?\\d+)([-+]\\d{4})?\\)/"); | |
| Matcher m = DATE_PATTERN.matcher(date); | |
| if (m.matches()) { | |
| long time = Long.parseLong(m.group(1)); | |
| long zone = 0; | |
| if (m.group(2) != null && m.group(2).length() > 0) | |
| zone = Integer.parseInt(m.group(2)) / 100 * 1000 * 60 * 60; |