So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By hary
#67477 Hi.

I have a D1 mini and am unable to blink the embeded LED.
I'm trying to do so by flashing with arduino IDE.
I'm trying with this code at least to see if something happens but the led stays on.
Code: Select allvoid setup() {
  for (int i =1; i<18; i++)
  {
  pinMode(i, OUTPUT);
  } 
}


void loop() {
    for (int i=1; i<18; i++)
      {
      digitalWrite(i, LOW); 
                               
      }                   
  delay(1000);
  for (int i=1; i<18; i++) 
  {
  digitalWrite(i, HIGH);}  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
     
}

I've even tried this but still, the led remains on ! Same if I digitalWrite (i, LOW) !
Code: Select allvoid setup() {
  for (int i =1; i<18; i++)
  {
  pinMode(i, OUTPUT);
  digitalWrite(i, HIGH);
  } 
}


Any advice ?
User avatar
By QuickFix
#67507 Why are you settings 18 pins? :?
The reason your code doesn't work, is because it will hang upon the point you set the modes of pins 6 to 11.
GPIO pins 6 to 11 are used to interface with the flash memory. :idea:

I have no problem getting the on-board LED to blink using this:
Code: Select all#define led_pin 2
#define led_interval 2000

void setup() {
  pinMode(led_pin, OUTPUT);
}

void loop() {
  digitalWrite(led_pin, HIGH);
  delay(led_interval);
  digitalWrite(led_pin, LOW);
  delay(led_interval);
}
User avatar
By hary
#67638
QuickFix wrote:Why are you settings 18 pins? :?


Well, I tried first pin 2, then 4, but that didn't work, so I decided to try all of them in one go ! Seems to be a mistake.

I feel very unconfortable with ESP82266 pin mapping. I'm always confused between GPIO numbering and pin numbering, plus when it's raw esp8266 and when it's D1 mini. So many version !

I'll try your code when I get back my D1 mini in hand again.

Thanks for you reply.
User avatar
By hary
#67661 No way, your code doesn't make any difference.

I tried with different version of Arduino and different machine (Intel Linux and Raspberry Pi).
I also tried different board from the IDE (WeMos D1 R2 & mini, WeMos D1(Retired), Generic ESP8266 Module)

I have no idea how to solve this problem.