Whenever I attempt to upload this:
void setup() {
// put your setup code here, to run once:
pinMode(52, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(52, HIGH);
delay(500);
digitalWrite(52, LOW);
delay(500);
}
piece of code to my Arduino Mega 2560 it gives this error:
Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
c:/program files/windowsapps/arduinollc.arduinoide_1.8.33.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/avr6/crtatmega2560.o:(.init9+0x0): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have no idea how to fix it. Please help
EDIT: I am using Arduino IDE 1.8.12