01s | Esp-01
void loop() digitalWrite(LED, LOW); // on delay(1000); digitalWrite(LED, HIGH); delay(1000);
GPIO0, GPIO2 (both with external 10k pull-ups if original ESP-01). esp-01 01s
Always buy ESP-01S unless you have a specific need for the original's smaller flash (almost never). For anything beyond two I/O pins, skip both and use ESP-12E/F, Wemos D1 Mini, or NodeMCU. void loop() digitalWrite(LED
DHT dht(DHTPIN, DHTTYPE); WiFiClient espClient; PubSubClient client(espClient); // on delay(1000)
void setup() dht.begin(); WiFi.begin("SSID", "PASS"); client.setServer("192.168.1.100", 1883);
void loop() float h = dht.readHumidity(); float t = dht.readTemperature(); client.publish("sensor/temp", String(t).c_str()); delay(30000);
#include <ESP8266WiFi.h> #include <PubSubClient.h> #include <DHT.h> #define DHTPIN 0 #define DHTTYPE DHT11