diff --git a/es/blatt3/uebung3-2/uebung3-2.ino b/es/blatt3/uebung3-2/uebung3-2.ino index 9ec5a04..97916a8 100644 --- a/es/blatt3/uebung3-2/uebung3-2.ino +++ b/es/blatt3/uebung3-2/uebung3-2.ino @@ -1,4 +1,4 @@ -#include +#include // these variables describe the used hardware pins // adjust them when you use other pins @@ -10,7 +10,7 @@ Servo ourServo; // used to achieve a 10 Hz frequency // don't touch them -int rc = 1049999; +long rc = 1049999; /** * Setup function for initial setup code @@ -20,8 +20,6 @@ void setup() { ourServo.attach(servoPin); ourServo.write(90); - pinMode(servoPin, OUTPUT); - // initialize serial port Serial.begin(9600); } @@ -35,12 +33,12 @@ void loop() { delay(10); } delay(1000); - for (int i = 180; i >= -180; --i) { + for (int i = 180; i >= 0; --i) { ourServo.write(i); delay(10); } delay(1000); - for (int i = -180; i <= 90; ++i) { + for (int i = 0; i <= 90; ++i) { ourServo.write(i); delay(10); }