I recently bought a Arduino Mega 2560 from Aliexpress. I hooked it up to my laptop (Windows 11 MSI laptop) and tried compiling and uploading this code.
<code>// Define the pin number for the LED
const int ledPin = 13;
// The setup function runs once when you press reset or power the board
void setup() {
// Initialize digital pin 13 as an output
pinMode(ledPin, OUTPUT);
}
// The loop function runs over and over again forever
void loop() {
// Turn the LED on (HIGH is the voltage level)
digitalWrite(ledPin, HIGH);
// Wait for a second (1000 milliseconds)
delay(1000);
// Turn the LED off by making the voltage LOW
digitalWrite(ledPin, LOW);
// Wait for a second
delay(1000);
}
</code>
<code>// Define the pin number for the LED
const int ledPin = 13;
// The setup function runs once when you press reset or power the board
void setup() {
// Initialize digital pin 13 as an output
pinMode(ledPin, OUTPUT);
}
// The loop function runs over and over again forever
void loop() {
// Turn the LED on (HIGH is the voltage level)
digitalWrite(ledPin, HIGH);
// Wait for a second (1000 milliseconds)
delay(1000);
// Turn the LED off by making the voltage LOW
digitalWrite(ledPin, LOW);
// Wait for a second
delay(1000);
}
</code>
// Define the pin number for the LED
const int ledPin = 13;
// The setup function runs once when you press reset or power the board
void setup() {
// Initialize digital pin 13 as an output
pinMode(ledPin, OUTPUT);
}
// The loop function runs over and over again forever
void loop() {
// Turn the LED on (HIGH is the voltage level)
digitalWrite(ledPin, HIGH);
// Wait for a second (1000 milliseconds)
delay(1000);
// Turn the LED off by making the voltage LOW
digitalWrite(ledPin, LOW);
// Wait for a second
delay(1000);
}
This is a basic code for blinking a light hooked to pin 13 and ground. Which shouldn’t require a long time to upload. The IDE stuck at uploading for a while before emitting these error code.
<code>Sketch uses 1536 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1
</code>
<code>Sketch uses 1536 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1
</code>
Sketch uses 1536 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1
I suspect it must be a driver issue caused by the unoffical chinnese mega board, but i’m honestly unsure. What could I do to resolve this?