Serial.print skipped in void setup()

We keep or move all the cool LeoStick demos, fun stuff, example code and sketches here...
Locked
shackers
Posts: 4
Joined: Fri Jul 13, 2012 8:26 am

Serial.print skipped in void setup()

Post by shackers » Fri Jul 13, 2012 10:03 am

the following code executes correctly when compiled/loaded on a Uno but skips the "Hello World" output on a leostick

Anyone know why? The monitor baud rate has no effect on the result

void setup()
{
Serial.begin(57600); // set up Serial library at 57600 bps
Serial.println("Hello world!"); // prints hello with ending line break
}

void loop()
{
Serial.println("Goodbye world!");
delay(1000);
}

shackers
Posts: 4
Joined: Fri Jul 13, 2012 8:26 am

Re: Serial.print skipped in void setup()

Post by shackers » Sun Jul 15, 2012 12:50 am

Try running this on a Leostick. the variable 'i' IS updated during setup, but the "Hello World" serial print ISN'T executed - or at least, it doesn't appear in the serial monitor window..

But works fine on a Uno! Am I missing something here?

int i=0;
void setup()
{
Serial.begin(57600);
i = 1;
Serial.println("Hello world!");
}

void loop()
{
Serial.print(i);
Serial.println(" Goodbye world!");
delay(1000);
}

Locked

Who is online

Users browsing this forum: No registered users and 1 guest