File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -28,21 +28,21 @@ void setup()
28
28
29
29
void loop ()
30
30
{
31
- // The button_pin is declared as INPUT_PULLUP which means switch logic is inverted.
32
- // It gives LOW when the switch is pressed and HIGH when it is open
33
- if (digitalRead (button_pin) == LOW) // Start the servo if the button is pressed and complete the
34
- // entire rotation regardless of button state later
31
+ // The button_pin is declared as INPUT_PULLUP which means switch logic is inverted.
32
+ // It gives LOW when the switch is pressed and HIGH when it is open
33
+ if (digitalRead (button_pin) == LOW) // Start the servo if the button is pressed and complete the
34
+ // entire rotation regardless of button state later
35
35
{
36
- digitalWrite (LED_BUILTIN, HIGH); // status that wiper servo is activated
36
+ digitalWrite (LED_BUILTIN, HIGH); // status that wiper servo is activated
37
37
for (int pos = startpos; pos <= endpos; pos += 1 ) // goes from starting angle to end angle in steps of 1 degree
38
38
{
39
39
myservo.write (pos); // tell servo to go to position in variable 'pos'
40
- delay (5 ); // waits 15ms for the servo to reach the position
40
+ delay (5 ); // waits for the servo to reach the position
41
41
}
42
42
for (int pos = endpos; pos >= startpos; pos -= 1 ) // goes from end angle to start angle again
43
43
{
44
44
myservo.write (pos); // tell servo to go to position in variable 'pos'
45
- delay (5 ); // waits 15ms for the servo to reach the position
45
+ delay (5 ); // waits for the servo to reach the position
46
46
}
47
47
}
48
48
digitalWrite (LED_BUILTIN, LOW); // status that wiper servo has stopped
You can’t perform that action at this time.
0 commit comments