// for ESP-01 we will use the TX pin (Pin 1) IF this doesn't work, then RX which is Pin 3 const int powerLatch = 3; const int led = 2; // GPIO2 void setup() { // Define pin as an OUTPUT pinMode(powerLatch, OUTPUT); pinMode(led, OUTPUT); // Keeps the circuit on digitalWrite(powerLatch, HIGH); // Turn ON an LED connected to GPIO 2 // (after the powerLatch pin is set to LOW, your board powers off and it also turns off this LED automatically) digitalWrite(led, LOW); delay(1000); digitalWrite(led, HIGH); // ADD YOUR TASK HERE (HTTP REQUEST, MQTT Message, Datalogger, etc) // Waits for 10 seconds delay(1000); digitalWrite(led, LOW); delay(1000); digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); // Turns the power latch circuit off digitalWrite(powerLatch, LOW); digitalWrite(led, HIGH); } void loop() { }