Hi,
I have got my Duemilanove recenlty. I wrote a simple program to print the data to the Serial Port. The problem is that my program restarts whenever the Serial Moniotr or any such tool is opened(Hyper terminal or any custom application that uses the same COM port).
Steps to reproduce the issue:
Get a Duemilanove which is connected to the PC through USB Cable.
1. Run the given program(below)
2. Open the serial monitor -> you will see the LED goes HIGH and then LOW and then printing values 1, 2, 3 etc
3. Close serial monitor and reopen it
Expected result:
a) Serial Monitor should display the values from somewhere 7 , 8 ,9 and then go on.
b) The LED on pin 13 should not blink.
Actual result:
a)Serial Monitor displays the values AGAIN FROM 1,2,3...
b) LED on13 blinks again.
My questions:
a) is it intented behavior?
b) can I make it NOT to restart my application whenever Serial Monitor(or any app that opens the same COM port) is invoked/ ?
Here is the program that tried with:
int ledpin = 13;
int counter = 0;
void setup()
{
Serial.begin(9600);
digitalWrite(ledpin,HIGH);
delay(100);
digitalWrite(ledpin,LOW);
delay(100);
}
void loop()
{
counter++;
Serial.println(counter);
if(counter >=255)
counter =0;
delay(1000);
}