Only RGB LED blinks in "BLINK AN LED"

Hi there,
I’m so excited to join this community.

I just set up my Core and select “BLINK AN LED” example and click the lightning icon in the IDE.
It worked! The RGB LED (D0) blinks!

Question:
If I understand it, in the code we are turning ON/OFF the small LED as well (D7).
But it doesn’t blink. Am I missing something?

void loop() {
  digitalWrite(led, HIGH);   // Turn ON the LED pins
  digitalWrite(led2, HIGH);
  delay(1000);               // Wait for 1000mS = 1 second
  digitalWrite(led, LOW);    // Turn OFF the LED pins
 digitalWrite(led2, LOW); 
 delay(1000);               // Wait for 1 second in off mode
}

Thanks in advance,
Taro

Where’s the void setup()?

Sorry I wasn’t very clear. I didn’t change anything “BLINK AN LED” code. I just ran it.
So void set() is as follows.

int led = D0;  // You'll need to wire an LED to this one to see it blink.
int led2 = D7; // This one is the built-in tiny one to the right of the USB jack

// This routine runs only once upon reset
void setup() {
  // Initialize D0 + D7 pin as output
  // It's important you do this here, inside the setup() function rather than outside it or in the loop function.
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
}

It should work fine unless the led is damaged somehow…

When you hold on to the RST button, does the led light up dimly?

Thanks for your help so far.

When you hold on to the RST button, does the led light up dimly?

Yes!
Also I click the flash icon and reinstall it, but it didn't change anything.

I think you might have mistaken… D0 is not the RGB led… D0 is just the D0 pin on the spark core and you need to connect an LED to it if you are going to test that out.

You will need to download this code to your spark core for testing. The firmware is not updated on the spark core when you make changes in the IDE. Downloading is required.

See: http://docs.spark.io/build/#flash-apps-with-spark-build-flashing-your-first-app

Now it works, but I don’t understand why.

  1. As kennethlimcp suggested to confirm that the small LED is not
    damaged, I pushed RST button.
  2. And the led light up dimly.
  3. After that I re-flashed the exact same code, and both LED work as expected.

It doesn’t make sense to me, but anyway it works as expected.

Thanks kennethlimcp for your help, I’d appreciate it!