Hi First time user of Arduino, I just bought an Elegoo Uno R3 as a kit. I have followed a simple online tutorial to flash LEDs in order. But every 15-20 seconds L, TX, RX LEDs on the board flash and reset the loop.
This is only when its plugged in to the USB of my laptop. When the (fresh out of the box) 9v battery power is connected (and the usb is disconnected) the L LED flashes at high frequency and the program will not run. As soon as I disconnect the battery and plug in the USB it starts the program as desired but resets when the L, TX, RX LEDs on the board flash.
Is this a hardware issue? should I be complaining to the supplier?
int yLED=12;
int gLED=11;
int rLED=10;
int fDELAY=5000;
void setup() {
// put your setup code here, to run once:
pinMode (10,OUTPUT);
pinMode (11,OUTPUT);
pinMode (12,OUTPUT);
pinMode (13,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13,LOW);
digitalWrite(rLED,HIGH);
delay(500);
digitalWrite(rLED,LOW);
delay(500);
digitalWrite(yLED,HIGH);
delay(500);
digitalWrite(yLED,LOW);
delay(500);
digitalWrite(gLED,HIGH);
delay(500);
digitalWrite(gLED,LOW);
delay(fDELAY);
}
The problem seems to be this:"But every 15-20 seconds L, TX, RX LEDs on the board flash and reset the loop"
Probably the Uno is continuously recognized and connects and disconnects cyclically.
Hi All,
thanks for your support.
I noticed late last night that, when I closed the laptop screen (not shut down the laptop), with the board still connected to the USB port, the problem stopped, and the loop ran without issue. I assume the the issue is with my laptop continually addressing the board.
I think @speedyant has hit the nail on the head.
Is there away to prevent the laptop continuously recognising and connecting and disconnecting cyclically?