You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+22-20Lines changed: 22 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@
4
4
5
5
### `attach()`
6
6
7
-
Attach the Servo variable to a pin. Note that in Arduino 0016 and earlier, the Servo library supports servos on only two pins: 9 and 10.
7
+
Attach the Servo variable to a pin. Note that in Arduino IDE 0016 and earlier, the Servo library supports servos on only two pins: 9 and 10.
8
8
9
9
#### Syntax
10
10
11
11
```
12
-
servo.attach(pin)
12
+
servo.attach(pin)
13
13
servo.attach(pin, min, max)
14
14
```
15
15
@@ -23,16 +23,16 @@ servo.attach(pin, min, max)
23
23
#### Example
24
24
25
25
```
26
-
#include <Servo.h>
26
+
#include <Servo.h>
27
27
28
28
Servo myservo;
29
29
30
-
void setup()
31
-
{
30
+
void setup()
31
+
{
32
32
myservo.attach(9);
33
-
}
33
+
}
34
34
35
-
void loop() {}
35
+
void loop() {}
36
36
```
37
37
38
38
#### See also
@@ -58,17 +58,17 @@ servo.write(angle)
58
58
#### Example
59
59
60
60
````
61
-
#include <Servo.h>
61
+
#include <Servo.h>
62
62
63
63
Servo myservo;
64
64
65
-
void setup()
66
-
{
65
+
void setup()
66
+
{
67
67
myservo.attach(9);
68
68
myservo.write(90); // set servo to mid-point
69
-
}
69
+
}
70
70
71
-
void loop() {}
71
+
void loop() {}
72
72
````
73
73
#### See also
74
74
@@ -81,7 +81,7 @@ Writes a value in microseconds (us) to the servo, controlling the shaft accordin
81
81
82
82
Note that some manufactures do not follow this standard very closely so that servos often respond to values between 700 and 2300. Feel free to increase these endpoints until the servo no longer continues to increase its range. Note however that attempting to drive a servo past its endpoints (often indicated by a growling sound) is a high-current state, and should be avoided.
83
83
84
-
Continuous-rotation servos will respond to the writeMicrosecond function in an analogous manner to the write function.
84
+
Continuous-rotation servos will respond to the writeMicrosecond function in an manner analogous to the write function.
85
85
86
86
#### Syntax
87
87
@@ -97,17 +97,17 @@ servo.writeMicroseconds(us)
97
97
#### Example
98
98
99
99
````
100
-
#include <Servo.h>
100
+
#include <Servo.h>
101
101
102
102
Servo myservo;
103
103
104
-
void setup()
105
-
{
104
+
void setup()
105
+
{
106
106
myservo.attach(9);
107
107
myservo.writeMicroseconds(1500); // set servo to mid-point
108
-
}
108
+
}
109
109
110
-
void loop() {}
110
+
void loop() {}
111
111
````
112
112
113
113
#### See also
@@ -118,7 +118,9 @@ void loop() {}
118
118
119
119
### `read()`
120
120
121
-
Read the current angle of the servo (the value passed to the last call to [write()](#write)).
121
+
Read the current setpoint of the servo (the angle passed to the last call to [write()](#write)).
122
+
123
+
Note that the servo has no way of reporting its current physical orientation. This method returns the angle to which the sketch program has requested the servo to move, regardless of whether the servo has already reached that angle.
122
124
123
125
#### Syntax
124
126
@@ -132,7 +134,7 @@ servo.read()
132
134
133
135
#### Returns
134
136
135
-
The angle of the servo, from 0 to 180 degrees.
137
+
The setpoint of the servo, as an angle from 0 to 180 degrees.
Copy file name to clipboardExpand all lines: docs/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
4
4
This library allows an Arduino board to control RC (hobby) servo motors. Servos have integrated gears and a shaft that can be precisely controlled. Standard servos allow the shaft to be positioned at various angles, usually between 0 and 180 degrees. Continuous rotation servos allow the rotation of the shaft to be set to various speeds.
5
5
6
-
The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables `analogWrite()` (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins. On the Mega, up to 12 servos can be used without interfering with PWM functionality; use of 12 to 23 motors will disable PWM on pins 11 and 12.
6
+
The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables `analogWrite()` (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins. On the Mega, up to 12 servos can be used without interfering with PWM functionality; use of 12 to 23 motors will disable PWM on pins 11 and 12.
Copy file name to clipboardExpand all lines: examples/Knob/readme.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Knob
2
2
3
-
Control the position of a RC (hobby) [servo motor](http://en.wikipedia.org/wiki/Servo_motor#RC_servos) with your Arduino and a potentiometer.
3
+
Control the position of an RC (hobby) [servo motor](http://en.wikipedia.org/wiki/Servo_motor#RC_servos) with your Arduino and a potentiometer.
4
4
5
5
This example makes use of the Arduino `Servo` library.
6
6
@@ -15,7 +15,7 @@ This example makes use of the Arduino `Servo` library.
15
15
16
16
Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the board. The signal pin is typically yellow or orange and should be connected to pin 9 on the board.
17
17
18
-
The potentiometer should be wired so that its two outer pins are connected to power (+5V) and ground, and its middle pin is connected to analog input 0 on the board.
18
+
The potentiometer should be wired so that its two outer pins are connected to power (5V) and ground, and its middle pin is connected to analog input 0 on the board.
0 commit comments