Im new to spark, and dont know how to see the console. Can someone please inform me how? Sample code below.
// Define the pins we’re going to call pinMode on
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
int cnter=0;
// 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);
}
// This routine gets called repeatedly, like once every 5-15 milliseconds.
// Spark firmware interleaves background CPU activity associated with WiFi + Cloud activity with your code.
// Make sure none of your code delays or blocks for too long (like more than 5 seconds), or weird things can happen.
void loop() {
cnter++;
Serial.println(cnter);
digitalWrite(led, HIGH); // Turn ON the LED pins
digitalWrite(led2, HIGH);
delay(310); // Wait for 1000mS = 1 second
digitalWrite(led, LOW); // Turn OFF the LED pins
digitalWrite(led2, LOW);
delay(300); // Wait for 1 second in off mode
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 for prompt reply.
your code doesnt complie and serial begin doesnt work in mine either.
Im familiar with arduino. I just go to serial console as see the serial output.
I dont have a clue how to do this on spark
/blink_an_led.cpp:2:7: error: ‘serial’ was not declared in this scope
/blink_an_led.cpp: In function 'void loop()':
/blink_an_led.cpp:6:7: error: 'serial' was not declared in this scope
Thanks for replies.
IM aware how to do com port serial.print, but was hoping for wifi.
If this is ide, or gnu, can someone show the steps that need to be done?