Problems Flashing the Core

Hello Forum,
I am new to spark but have had some experience with Arduino. I was trying to flash the basic LED blinking example. My core is connected through USB and I cannot upload to it. If I click the flash button the IDE tells me “Flashing code…” The core starts flashing magenta, wildly. Then after a few seconds the IDE says “Ready” but the core is still flashing magenta. After another 10 seconds the core starts to flash green and the code has not been flashed.
Here is the code:

// Program to blink an LED connected to pin D0
// of the Spark Core.

// We name pin D0 as led
int led = D0;

// This routine runs only once upon reset
void setup()
  // Initialize D0 pin as output
  pinMode(led, OUTPUT);

// This routine loops forever
void loop()
  digitalWrite(led, HIGH);   // Turn ON the LED
  delay(1000);               // Wait for 1000mS = 1 second
  digitalWrite(led, LOW);    // Turn OFF the LED
  delay(1000);               // Wait for 1 second

How do you know the code isn’t running? Have you got something hooked up to D0?

Thank you for the prompt reply! Yes, I have an LED. I know it’s working because I tried it with an Arduino Uno.

You could use D7 for testing purposes as well, it’s the small blue on-board LED.
Could you try if you can still control your Core with the Tinker app, if that’s what was still on it before flashing? Trying to flash it again might also fix the problem if you’re willing to give it a try.

Interestingly enough using pin D7 works as it should! Thank you for your help. What do you think is preventing it from working on D0?

Glad that’s working. Perhaps there was an error while flashing and it worked now. There could of course have been an error in the wiring. But since you say you’ve got experience with Arduino that should be unlikely. If you want you could share a schematic of your setup (fritzing), or maybe a picture?

It wasn’t a one time error with the flashing. I tried it multiple times. I used the exact same breadboard layout as they used in the example. Here it is:


Strange… Are you certain the LED is functional? I’ve had reversed LEDs before, which were switched in their housing.

Wow. The LED wasn’t working. I had that and the LED I knew was working laid out on the table and I mistook one of the other! Thank you SO much for helping me find the problem and putting up with the absurdity of the situation!
Thanks again,