Go Down

Topic: Side efects of launching the serial monitor (Read 181 times) previous topic - next topic

guy_c

Hello,
Please refer to the code below where digout is initialized as output and set high. When the code is loaded to the Uno, the pin does go hi but  and i press <shif><ctrl>M, the pin is pulsed low! before going high again. This would applies to whatever Uno's pins. The net effect is that launching the monitor my destroy a board's power on state set by the "Setup()" procedure!

Is this unavoidable?
Does launching the serial monitor forces a full reset an re-executes Setup()?
What is the suggested workaround?
Thanks in advance for your time
Guy


#define digout 4
void setup() {   
  pinMode(digout, OUTPUT);     
  digitalWrite(digout, HIGH);
  Serial.begin(9600);
}
void loop() {     
  Serial.println("press kb");
  while (Serial.available()<=0);
  Serial.read();
  Serial.println("starting");
}

AWOL

Quote
The net effect is that launching the monitor my destroy a board's power on state set by the "Setup()" procedure" resets the Arduino board

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

guy_c

Thanks. board is indeed entirely reinitialized and it aint an issue

Go Up