O LED vermelho é ligado diretamente à alimentação e o LED azul é ligado ao TX da serial. Se você não usar a serial no seu projeto pode controlar esse LED usando GPIO1, conforme o código abaixo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
/* Blink the blue LED on the ESP-01 module Based on Blink without Delay. This example code is in the public domain http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay */ const int ledPin = 1; // The blue LED on the ESP-01 module is connected to GPIO1 // (which is also the TXD pin; so we cannot user Serial at the same time int ledState = LOW; unsigned long previousMillis = 0; const long interval = 1000; void setup() { pinMode(ledPin, OUTPUT); } void loop() { unsigned long currentMillis = millis(); if(currentMillis - previousMillis >= interval) { previousMillis = currentMillis; if (ledState == LOW) ledState = HIGH; else ledState = LOW; digitalWrite(ledPin, ledState); } } |
Ótimo post: Simples e objetivo