Ok I FINALLY have it working… seriously this feature needs to be looked at >.>
What I have to do is a bit hacky, but it works.
- Close Serial Terminal Software (I’m using Tera Term VT 4.80)
- Flash Core with code that enables Serial in setup(), but waits for a character before it continues.
- Wait till Core reboots and connects to the Cloud (Breathing Cyan)
- Open Serial Terminal Software.
- Open a Serial Connection at the correct baud, 8 bits, no parity, 1 stop, no flow control.
- Press Enter within 15 seconds of Cyan LED first Breath.
- Bingo bango, kiss the screen! You have serial debugging over USB. Have a
or
uint32_t counter = 0;
void setup()
{
Serial.begin(9600); // Open serial over USB.
while(!Serial.available()); // Just chill until we Rx a character. Don't chill
pinMode(D7,OUTPUT); // more than 15 seconds or the core will choke.
}
void loop()
{
Serial.print("Spark Core says Hello over USB! ");
Serial.println(counter++);
digitalWrite(D7,HIGH);
delay(500);
digitalWrite(D7,LOW);
delay(500);
}
I initially had a timer and state machine in the main loop, but this is way more efficient and has no effect on the user code once you are out of setup(). I don’t like to have to do this, but I’m happy that I can ditch my FTDI friend for the moment.