1

I have just bought an Arduino UNO R3 and I'm trying to get a small LED to blink every other second. But each time I try to verify or upload the code, I get the same error: "Error compiling for board Arduino/Genuino Uno". I have selected the correct board and port, and I have connected the LED correctly. Any help is appreciated.

Here is the code:

void setUp()
{
  pinMode(13, OUTPUT);
}
void loop()
{
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}

2 Answers 2

1

You're missing like 4/5 of the error message.

undefined reference to `setup'

is part of it.

Rename setUp to setup and it will compile.

See Arduino TUTORIALS > Built-In Examples > 01.Basics > BareMinimum

This example contains the bare minimum of code you need for a sketch to compile properly on Arduino Software (IDE): the setup() method and the loop() method.

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}
Sign up to request clarification or add additional context in comments.

Comments

1

You have a typo. It needs to be:

void setup() {
}

Check this out: https://www.arduino.cc/reference/en/language/structure/sketch/setup/

The IDE cannot find your Setup function, that's the problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.