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); }

jsotola
  • 1,554
  • 2
  • 12
  • 20
Jacob Ivanov
  • 111
  • 1
  • 2

1 Answers1

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.

Majenko
  • 105,851
  • 5
  • 82
  • 139