-->
Page 1 of 2

4 GPIO ports of ESP8266-01 control 4(5) LEDs

PostPosted: Tue Jun 02, 2015 2:57 am
by HermannSW

GPIO 0, 1(=TXD), 2 and 3(=RXD), ESP8266-01 TXD LED is controlled by reverse logic

Re: 4 GPIO ports of ESP8266-01 control 4(5) LEDs

PostPosted: Tue Jun 02, 2015 7:55 am
by hwiguna
That is COOL!
Could you tell us more about it?
1) What firmware are you using?
2) What do you mean by "reverse logic"? LEDs are wired so low on GPIO pins turn LED on?
3) Is it also possible to have up to four digital inputs then?

Re: 4 GPIO ports of ESP8266-01 control 4(5) LEDs

PostPosted: Tue Jun 02, 2015 12:34 pm
by HermannSW
1) Arduino IDE
2)
digitalWrite(i, HIGH) turns on external LED connected to GPIO i, LOW turns it off
digitalWrite(1, LOW) turns ON the blue LED, HIGH turns it off
See the video, the back left and the blue ESP8266-01 LED are alway inverse.
3)
Yes, but I have not tested yet -- you have GPIO 0-3 and can do whatever you want.
I did write to pin 1 (TXD) before for Arduino Blink example.
What was new to me was that we can use GPIO3 (RXD) as well.

This is the complete sketch I used for the LED video:
Code: Select allint i;
void setup() {
  for(i=0; i<=3; ++i) {
    pinMode(i, OUTPUT);
    digitalWrite(i, LOW);
  }
}
void loop() {
  for(i=0; i<=3; ++i) {
    delay(1000);
    digitalWrite(i, 1 - digitalRead(i) );
  }
}


Hermann.

Re: 4 GPIO ports of ESP8266-01 control 4(5) LEDs

PostPosted: Tue Jun 02, 2015 12:40 pm
by j0hncc
Nice work HermannSW.

But it looks to me like the Leds must have all the same ("active Low") logic, there are 5 wires to breadboard (1 for each led, and VCC) ??