Go Down

Topic: Lesson 9 Servo (Read 2692 times) previous topic - next topic

DustinKern

Hello,
In Lesson 9 is the code wrong. The only thing thatpops off is "exit status 1 redefinition of 'void setup()'".
I dont know what i can do. Thank you for all help. :)

dannable

Post your code, in code tags.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

DustinKern

#2
Aug 23, 2017, 11:08 am Last Edit: Aug 23, 2017, 11:19 am by DustinKern
Code: [Select]

#include <Servo.h>

Servo myservo; 

int pos = 0;   

void setup() {
  myservo.attach(9); 
}

void loop() {
  for (pos = 0; pos <= 180; pos += 1) {
    myservo.write(pos);             
    delay(15);                       
  }
  for (pos = 180; pos >= 0; pos -= 1) {
    myservo.write(pos);             
    delay(15);                       
  }
}

dannable

Compiles fine for me with the default setup.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

DustinKern

Thank you for Help. I reinstalled the IDE and it worked. should had done it earlier. :smiley-sweat:

Go Up