Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
k0xxx committed Apr 20, 2022
1 parent 65cc024 commit df4a4dd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ void loop() {
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);

// for(servoTmpAngle = 0; servoTmpAngle < servoTargetAngle; servoTmpAngle += 1) // goes from 0 degrees to 180 degrees
// { // in steps of 1 degree
// servoControl.write(servoTmpAngle); // tell servo to go to position in variable 'pos'
// delay(servoRefresh); // waits 20ms for refresh period
// SoftRcPulseOut::refresh(1); // generates the servo pulse
// }
for(servoTmpAngle = 0; servoTmpAngle < servoTargetAngle; servoTmpAngle += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
servoControl.write(servoTmpAngle); // tell servo to go to position in variable 'pos'
delay(servoRefresh); // waits 20ms for refresh period
SoftRcPulseOut::refresh(1); // generates the servo pulse
}
} else {
servoAngle = servoDefaultAngle;
digitalWrite(0, LOW);
digitalWrite(1, LOW);
// for(servoTmpAngle = servoTargetAngle; servoTmpAngle>=1; servoTmpAngle-=1) // goes from 180 degrees to 0 degrees
// {
// servoControl.write(servoTmpAngle); // tell servo to go to position in variable 'pos'
// delay(servoRefresh); // waits 20ms for for refresh period
// SoftRcPulseOut::refresh(1); // generates the servo pulse
// }
for(servoTmpAngle = servoDefaultAngle; servoTmpAngle>=1; servoTmpAngle-=1) // goes from 180 degrees to 0 degrees
{
servoControl.write(servoTmpAngle); // tell servo to go to position in variable 'pos'
delay(servoRefresh); // waits 20ms for for refresh period
SoftRcPulseOut::refresh(1); // generates the servo pulse
}
}


Expand Down

0 comments on commit df4a4dd

Please sign in to comment.