Modify code +- limits for pwm sweep

This commit is contained in:
Kenwood 2021-06-28 01:29:59 -04:00
parent c2439c8fa1
commit 75cb115330
1 changed files with 4 additions and 2 deletions

View File

@ -16,9 +16,7 @@ int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 70; pos <= 130; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
@ -29,3 +27,7 @@ void loop() {
delay(15); // waits 15ms for the servo to reach the position
}
}
void loop() {
delay(1000);
}