Browse code

Formatting and punctuation

haywalk authored on 05/11/2020 18:55:35
Showing 1 changed files

... ...
@@ -5,20 +5,20 @@
5 5
 
6 6
 #include <Servo.h> // Include the Arduino servo library
7 7
 
8
-Servo myservo; // Create a new servo object
8
+Servo myServo; // Create a new servo object
9 9
 
10 10
 /*
11 11
  * Define constants
12 12
  */
13
-#define servoPin 9 // Define 9 as being the servo pin
14
-#define startPosition 30 // Set the start position
15
-#define maxPosition 110 // Set maximum angle
16
-#define margin 30 // Set sensitivity
13
+#define servoPin        9   // Define 9 as being the servo pin
14
+#define startPosition   30  // Set the start position
15
+#define maxPosition     110 // Set maximum angle
16
+#define margin          30  // Set sensitivity
17 17
 
18 18
 
19 19
 void setup() {
20
-  myservo.attach(servoPin); // Attach the servo to pin 9
21
-  myservo.write(startPosition); // Start with the servo at the start position
20
+  myServo.attach(servoPin); // Attach the servo to pin 9
21
+  myServo.write(startPosition); // Start with the servo at the start position
22 22
 }
23 23
 
24 24
 void loop() {
... ...
@@ -39,7 +39,7 @@ void adjust(int currentAng){
39 39
     currentAng += 1; // Move left
40 40
   }
41 41
 
42
-  myservo.write(currentAng); // Move the servo to its new position
42
+  myServo.write(currentAng); // Move the servo to its new position
43 43
   delay(100); // Wait 100ms
44 44
 
45 45
   // Recurse and make the new angle the current one