1 / 2
Aug 2017

I have written a program in Arduino:

int pin = 9;
int brightness = 0;
int fadeAmount = 5;

void setup () {
pinMode(9, OUTPUT);
#include iostream (of course iostream is enclosed in <>)
}

void loop() {
analogWrite(pin, brightness);
brightness = brightness + fadeAmount;
digitalWrite (pin, HIGH);
delay (1000);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (1000);
digitalWrite (pin, HIGH);
delay (800);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (800);
digitalWrite (pin, HIGH);
delay (600);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (600);
digitalWrite (pin, HIGH);
delay (400);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (400);
digitalWrite (pin, HIGH);
delay (200);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (200);
digitalWrite (pin, HIGH);
delay (100);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (100);
digitalWrite (pin, HIGH);
delay (50);
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
digitalWrite (pin, LOW);
delay (50);
printf ("Liked it?);

}

It's simple, however I get always the same error message:

Exit status 1
Error compiling for board Arduino/Genuino Uno

(note: I only veryfied the program, as I have not connected the Arduino board to the PC. However, I was only verifying it... PC with windows 10). Thanks to all the people who will try to help me

  • created

    Aug '17
  • last reply

    Aug '17
  • 1

    reply

  • 1.9k

    views

  • 1

    user

11 days later

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 34 26d

Want to read more? Browse other topics in C and C++ or view latest topics.