-->
Page 2 of 2

Re: How to blink onboard blue LED wifi ?

PostPosted: Fri Nov 04, 2016 7:25 pm
by mrburnette
http://www.esp8266.com/viewtopic.php?f=33&t=2897

Serial.swap may work now, unknown. But theblue LED is a status LED and is there only to show serial activity.

Ray

Re: How to blink onboard blue LED wifi ?

PostPosted: Mon Nov 14, 2016 7:28 am
by Stévanovich
Hello,

Here is soluce , i found it on expressif web site.

Code: Select all
#define FUNC_U0CTS    4
#define FUNC_U0RTS    4

//////////////////////////////////////////////////////////////////////////////
//
//
// SETUP
//
/////////////////////////////////////////////////////////////////////////////

void setup() {
  PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_U0CTS);//CONFIG MTCK PIN FUNC TO U0CTS
  PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_U0RTS);//CONFIG MTDO PIN FUNC TO U0RTS
  SET_PERI_REG_MASK(0x3ff00028 , BIT2);//SWAP PIN : U0TXD<==>U0RTS(MTDO) , U0RXD<==>U0CTS(MTCK)
  /* Initializations */



Code: Select allconst int _WiFiLed1 = 2;


// AJOUTER CETTE LIGNE APRES DANS LE SETUP
// pinMode( _WiFiLed, OUTPUT);


// Sert à controller la led WiFi
// Attention INCOMPATIBLE avec les transmission Tx/Rx
// Trois mode
// 0 - Eteindre
// 1 - Allumer
// 2 - Inverser
void WiFiLed(int m){
   //Serial.print("*** OnBoard Led > ");
   pinMode(_WiFiLed1, OUTPUT);
   if (m == 0) {
      digitalWrite(_WiFiLed1, HIGH);
      //Serial.println("0");
      return;
   }
   if (m == 1){
      digitalWrite(_WiFiLed1, LOW);
      //Serial.println("1");
      return;
   }
   if (m == 2){
      if (digitalRead(_WiFiLed1) == HIGH){
         digitalWrite(_WiFiLed1, LOW);
         //Serial.println("1");
         return;
         }
      if (digitalRead(_WiFiLed1) == LOW){
         digitalWrite(_WiFiLed1, HIGH);
         //Serial.println("0");
         return;
      }
   }
}



Now , i ask myself wich gpio will be freeze with this mod ?
I cannot use GPIO6 / 7 / 8 / 9 / 11

Thanks,
Hope can be usefull for somebody else. ;)

Re: How to blink onboard blue LED wifi ?

PostPosted: Sat Feb 03, 2018 10:48 am
by aledrus
I am trying to use both the onboard LED and serial monitor to read status from the chip
My LED is connected to GPIO1 which is also the TX pin.

Using the docs from the replies above, I tried to call
Code: Select allSerial.begin(115200)
Serial.set_tx(2);


From what I understand, this sets the TX pin to GPIO2.
but still, the LED blinks fine but the Serial Monitor is not receiving anything on its display.

I am using the CH340 USB adapter to connect the ESP to the USB