Page 1 of 1

Serial.print skipped in void setup()

Posted: Fri Jul 13, 2012 10:03 am
by shackers
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);
}

Re: Serial.print skipped in void setup()

Posted: Sun Jul 15, 2012 12:50 am
by shackers
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);
}