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
}
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);
}
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.