Arduino keep conecting and disconecting from my computer

Hi there

I was programing this morning then I plug the arduino to upload some code.

But on my computer it start loading the connected and disconnected sound repeated over and over and after that there was no port selection on Arduino IDE.
Do anyone have any idea why and how to fix it?

BTW i am using a Arduino Uno from arduino.
Programing on Arduino IDE2.1

Thanks

Different cable
Different USB port
Inspect Arduino board port for damage

here the code that i was trying to upload:

// constants won't change
const int RELAY_PIN = 3; // the Arduino pin, which connects to the IN pin of relay

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin as an output.
pinMode(RELAY_PIN, OUTPUT);
pinMode(A2, INPUT);
Serial.begin(9600);
pinMode(A0, INPUT);
}

// the loop function runs over and over again forever
void loop() {
Serial.println(analogRead(A0));
if (1000 < analogRead(A0))
digitalWrite(3, HIGH );
else
digitalWrite(3, LOW);
}

the arduino was still power everything connected to it was flickering

Doesn't rule out any of those as an issue

but even before i plug it in it doesn't give me the port menu

How many times?
Does it stop?

no over and over again nonstop

Then there is almost certainly a hardware issue
Try my original suggestions

cables

All three, one at a time

ok thanks

i will get back to you

Try using other USB devices to rule out each item

I don't think it a uno problem because here
image

Disconnect the relay.

Perhaps the cable is bad. Tried a different one already?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.