mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
[ES] Fixed wrong boundaries
Signed-óff-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
#include <Servo.h>
|
#include <Servo>
|
||||||
|
|
||||||
// these variables describe the used hardware pins
|
// these variables describe the used hardware pins
|
||||||
// adjust them when you use other pins
|
// adjust them when you use other pins
|
||||||
@ -10,7 +10,7 @@ Servo ourServo;
|
|||||||
|
|
||||||
// used to achieve a 10 Hz frequency
|
// used to achieve a 10 Hz frequency
|
||||||
// don't touch them
|
// don't touch them
|
||||||
int rc = 1049999;
|
long rc = 1049999;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup function for initial setup code
|
* Setup function for initial setup code
|
||||||
@ -20,8 +20,6 @@ void setup() {
|
|||||||
ourServo.attach(servoPin);
|
ourServo.attach(servoPin);
|
||||||
ourServo.write(90);
|
ourServo.write(90);
|
||||||
|
|
||||||
pinMode(servoPin, OUTPUT);
|
|
||||||
|
|
||||||
// initialize serial port
|
// initialize serial port
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
}
|
}
|
||||||
@ -35,12 +33,12 @@ void loop() {
|
|||||||
delay(10);
|
delay(10);
|
||||||
}
|
}
|
||||||
delay(1000);
|
delay(1000);
|
||||||
for (int i = 180; i >= -180; --i) {
|
for (int i = 180; i >= 0; --i) {
|
||||||
ourServo.write(i);
|
ourServo.write(i);
|
||||||
delay(10);
|
delay(10);
|
||||||
}
|
}
|
||||||
delay(1000);
|
delay(1000);
|
||||||
for (int i = -180; i <= 90; ++i) {
|
for (int i = 0; i <= 90; ++i) {
|
||||||
ourServo.write(i);
|
ourServo.write(i);
|
||||||
delay(10);
|
delay(10);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user