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);
}
-
1comment out all lines ... then uncomment one at a time ... compile each timejsotola– jsotola2021年11月13日 21:34:01 +00:00Commented 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– Abel2021年11月14日 03:51:36 +00:00Commented Nov 14, 2021 at 3:51
-
If you read all the error message you'll see it complaining about a missing semicolon...Majenko– Majenko2021年11月14日 08:45:02 +00:00Commented Nov 14, 2021 at 8:45
1 Answer 1
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.
-
Thanks, that works.Jacob Ivanov– Jacob Ivanov2021年11月14日 21:00:57 +00:00Commented Nov 14, 2021 at 21:00
Explore related questions
See similar questions with these tags.