So, can someone walk me through this like I’m 5? I’m trying to compile the flash LED example here. I have two files open: thermostat.ino and application.cpp. thermostat.ino is blank and from what I understand is a needed file. My spark is named “thermostat”. the application.cpp file hes the example code in it:
// 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
}
When I try and compile in the cloud I get the errors:
application.cpp:5:11: error: 'D0' was not declared in this scope
int led = D0;
^
application.cpp: In function 'void setup()':
application.cpp:11:16: error: 'OUTPUT' was not declared in this scope
pinMode(led, OUTPUT);
^
application.cpp:11:22: error: 'pinMode' was not declared in this scope
pinMode(led, OUTPUT);
^
application.cpp: In function 'void loop()':
application.cpp:17:21: error: 'HIGH' was not declared in this scope
digitalWrite(led, HIGH); // Turn ON the LED
^
application.cpp:17:25: error: 'digitalWrite' was not declared in this scope
digitalWrite(led, HIGH); // Turn ON the LED
^
application.cpp:18:13: error: 'delay' was not declared in this scope
delay(1000); // Wait for 1000mS = 1 second
^
application.cpp:19:21: error: 'LOW' was not declared in this scope
digitalWrite(led, LOW); // Turn OFF the LED
^
make: *** [application.o] Error 1
Error: Could not compile. Please review your code.
What am I doing wrong? Thanks in advance for any help.