Hello everybody!
One short question: When I run the blink code on my Mega. The LED blinks first normal(one sec off, one sec on), but after 7-8 seconds LED turns on for 300-400ms and off the same time . And it happens twice or maybe more, but after it comes it is working well with one sec delay.
So for better understanding:
LED ON - 1000ms, LED OF - 1000ms, LED ON - 1000ms, LED OF - 1000ms, LED ON - 1000ms, LED OF - 1000ms, LED ON - 1000ms, LED OF - 1000ms,
LED ON - 300ms, LED OF - 300ms, LED ON - 300ms, LED OF - 300ms, LED ON - 300ms, LED OF - 300ms, LED ON - 1000ms, LED OF - 1000ms, LED ON - 1000ms, LED OF - 1000ms, LED ON - 1000ms, LED OF - 1000ms..
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
I have all so tried code "blink without delay", it was the same failure.
I have changed the code to this. I have turn on Serial Monitor to see what happens in that moment. Nothing happened and the blink worked perfect more than 5 minute. Serial printed millis() from 0 to xxxxxx. Everything works well! But when I close Serial Monitor the code don`t work properly(the same story). It seems that the board resets by it self.
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(12, OUTPUT);
Serial.begin(9600);
}
void loop() {
Serial.println(millis());
digitalWrite(12, HIGH); // set the LED on
delay(500); // wait for a second
digitalWrite(12, LOW); // set the LED off
delay(500); // wait for a second
}
Do you have anything running on your PC that might be going around and opening serial ports to see if they have certain devices attached? The usual problem is with bluetooth phone support...
Thank you for your replays! And so many attention! I have connected the board with battery and everything working just well! So the problem is with my PC or USB port/drivers.. And what is interesting the pc provides enough power to the board when Serial Monitor in arduino IDE is working. But when Seiral Monitor is turned off and board is just connected to PC via USB, it works not properly.. after 7-8 second it resets twice by it self.