0

I am a beginner with Arduino. I have a program that is intentionally simple.

The code refuses to compile, spitting out the error Compilation error: Error: 13 INTERNAL: exit status 1. I have gotten this type of error multiple times, and I have no idea what causes it, nor how to fix it.

My code is below, by the way.

void setup() {
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);

  analogWrite(10, 10);
}

void loop() {
  digitalWrite(9, HIGH);
  digitalWrite(11, LOW);
  delay(250)
  digitalWrite(9, LOW);
  digitalWrite(11, HIGH); 
}
3
  • 1
    comment out all lines ... then uncomment one at a time ... compile each time
    – jsotola
    Nov 13, 2021 at 21:34
  • might it be your board config? ide does some annoying stuff sometimes regarding where it caches crud, making getting a truly clean install more annoying than it should be.
    – Abel
    Nov 14, 2021 at 3:51
  • If you read all the error message you'll see it complaining about a missing semicolon...
    – Majenko
    Nov 14, 2021 at 8:45

1 Answer 1

4

The problem with that error message is that you are only reading the very last line. That line says "Oops, it didn't compile". The actual error message occurs before that. You need to read the entire message to know what is going on.

With your code, for example, you get the following output:

blah.ino: In function 'void loop()':
blah.ino:13:3: error: expected ';' before 'digitalWrite'
   digitalWrite(9, LOW);

That is your actual error. It's telling you that there's a semi-colon missing before the digitalWrite on line 13. There's nothing before the digitalWrite on line 13, but, if you look closely, you can see that line 12 has the semi-colon missing from the end of it.:

  delay(250)    <---- missing ;
  digitalWrite(9, LOW);

Thus it proves that it is always important to both read and (if you don't understand it) post the entire error message not just the last line.

1
  • Thanks, that works. Nov 14, 2021 at 21:00

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.