Skip to content

Commit 3a7e09e

Browse files
authored
Merge pull request #1 from arduino-libraries/master
Update
2 parents cf60c78 + aeef55f commit 3a7e09e

26 files changed

+774
-106
lines changed

.github/workflows/check-arduino.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Arduino Lint
22-
uses: arduino/arduino-lint-action@v1
22+
uses: arduino/arduino-lint-action@v2
2323
with:
2424
compliance: specification
2525
library-manager: update

.github/workflows/compile-examples.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,47 @@ jobs:
3434
- fqbn: arduino:avr:nano
3535
platforms: |
3636
- name: arduino:avr
37+
artifact-name-suffix: arduino-avr-nano
3738
- fqbn: arduino:avr:mega
3839
platforms: |
3940
- name: arduino:avr
41+
artifact-name-suffix: arduino-avr-mega
4042
- fqbn: arduino:avr:leonardo
4143
platforms: |
4244
- name: arduino:avr
45+
artifact-name-suffix: arduino-avr-leonardo
4346
- fqbn: arduino:megaavr:nona4809
4447
platforms: |
4548
- name: arduino:megaavr
49+
artifact-name-suffix: arduino-megaavr-nona4809
4650
- fqbn: arduino:sam:arduino_due_x_dbg
4751
platforms: |
4852
- name: arduino:sam
53+
artifact-name-suffix: arduino-sam-arduino_due_x_dbg
4954
- fqbn: arduino:samd:mkrzero
5055
platforms: |
5156
- name: arduino:samd
52-
- fqbn: arduino:mbed_portenta:envie_m4
57+
artifact-name-suffix: arduino-samd-mkrzero
58+
- fqbn: arduino:mbed_portenta:envie_m7:target_core=cm4
5359
platforms: |
5460
- name: arduino:mbed_portenta
61+
artifact-name-suffix: arduino-mbed_portenta-envie_m7-target_core-cm4
5562
- fqbn: arduino:mbed_portenta:envie_m7
5663
platforms: |
5764
- name: arduino:mbed_portenta
65+
artifact-name-suffix: arduino-mbed_portenta-envie_m7
5866
- fqbn: arduino:mbed_nano:nano33ble
5967
platforms: |
6068
- name: arduino:mbed_nano
69+
artifact-name-suffix: arduino-mbed_nano-nano33ble
6170
- fqbn: arduino:mbed_nano:nanorp2040connect
6271
platforms: |
6372
- name: arduino:mbed_nano
73+
artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
6474

6575
steps:
6676
- name: Checkout repository
67-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
6878

6979
- name: Compile examples
7080
uses: arduino/compile-sketches@v1
@@ -83,8 +93,8 @@ jobs:
8393
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
8494

8595
- name: Save sketches report as workflow artifact
86-
uses: actions/upload-artifact@v3
96+
uses: actions/upload-artifact@v4
8797
with:
8898
if-no-files-found: error
8999
path: ${{ env.SKETCHES_REPORTS_PATH }}
90-
name: ${{ env.SKETCHES_REPORTS_PATH }}
100+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}

.github/workflows/report-size-deltas.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
- name: Comment size deltas reports to PRs
2121
uses: arduino/report-size-deltas@v1
2222
with:
23-
# The name of the workflow artifact created by the sketch compilation workflow
24-
sketches-reports-source: sketches-reports
23+
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
24+
sketches-reports-source: ^sketches-report-.+

.github/workflows/spell-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Spell check
2222
uses: codespell-project/actions-codespell@master

.github/workflows/sync-labels.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131

3232
- name: Download JSON schema for labels configuration file
3333
id: download-schema
@@ -70,7 +70,7 @@ jobs:
7070
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
7171

7272
- name: Pass configuration files to next job via workflow artifact
73-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
7474
with:
7575
path: |
7676
*.yaml
@@ -105,16 +105,16 @@ jobs:
105105
echo "::set-output name=flag::--dry-run"
106106
107107
- name: Checkout repository
108-
uses: actions/checkout@v3
108+
uses: actions/checkout@v4
109109

110110
- name: Download configuration files artifact
111-
uses: actions/download-artifact@v3
111+
uses: actions/download-artifact@v4
112112
with:
113113
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
114114
path: ${{ env.CONFIGURATIONS_FOLDER }}
115115

116116
- name: Remove unneeded artifact
117-
uses: geekyeggo/delete-artifact@v2
117+
uses: geekyeggo/delete-artifact@v5
118118
with:
119119
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
120120

docs/api.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
### `attach()`
66

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.
88

99
#### Syntax
1010

1111
```
12-
servo.attach(pin)
12+
servo.attach(pin)
1313
servo.attach(pin, min, max)
1414
```
1515

@@ -23,16 +23,16 @@ servo.attach(pin, min, max)
2323
#### Example
2424

2525
```
26-
#include <Servo.h>
26+
#include <Servo.h>
2727
2828
Servo myservo;
2929
30-
void setup()
31-
{
30+
void setup()
31+
{
3232
myservo.attach(9);
33-
}
33+
}
3434
35-
void loop() {}
35+
void loop() {}
3636
```
3737

3838
#### See also
@@ -58,17 +58,17 @@ servo.write(angle)
5858
#### Example
5959

6060
````
61-
#include <Servo.h>
61+
#include <Servo.h>
6262
6363
Servo myservo;
6464
65-
void setup()
66-
{
65+
void setup()
66+
{
6767
myservo.attach(9);
6868
myservo.write(90); // set servo to mid-point
69-
}
69+
}
7070
71-
void loop() {}
71+
void loop() {}
7272
````
7373
#### See also
7474

@@ -81,7 +81,7 @@ Writes a value in microseconds (us) to the servo, controlling the shaft accordin
8181

8282
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.
8383

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.
8585

8686
#### Syntax
8787

@@ -97,17 +97,17 @@ servo.writeMicroseconds(us)
9797
#### Example
9898

9999
````
100-
#include <Servo.h>
100+
#include <Servo.h>
101101
102102
Servo myservo;
103103
104-
void setup()
105-
{
104+
void setup()
105+
{
106106
myservo.attach(9);
107107
myservo.writeMicroseconds(1500); // set servo to mid-point
108-
}
108+
}
109109
110-
void loop() {}
110+
void loop() {}
111111
````
112112

113113
#### See also
@@ -118,7 +118,9 @@ void loop() {}
118118

119119
### `read()`
120120

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.
122124

123125
#### Syntax
124126

@@ -132,7 +134,7 @@ servo.read()
132134

133135
#### Returns
134136

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.
136138

137139
#### See also
138140

docs/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
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.
55

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.
77

88
To use this library:
99

examples/Knob/Knob.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
#include <Servo.h>
1111

12-
Servo myservo; // create servo object to control a servo
12+
Servo myservo; // create Servo object to control a servo
1313

1414
int potpin = A0; // analog pin used to connect the potentiometer
1515
int val; // variable to read the value from the analog pin
1616

1717
void setup() {
18-
myservo.attach(9); // attaches the servo on pin 9 to the servo object
18+
myservo.attach(9); // attaches the servo on pin 9 to the Servo object
1919
}
2020

2121
void loop() {

examples/Knob/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Knob
22

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.
44

55
This example makes use of the Arduino `Servo` library.
66

@@ -15,7 +15,7 @@ This example makes use of the Arduino `Servo` library.
1515

1616
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.
1717

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.
1919

2020
![](images/knob_BB.png)
2121

examples/Sweep/Sweep.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
#include <Servo.h>
1111

12-
Servo myservo; // create servo object to control a servo
13-
// twelve servo objects can be created on most boards
12+
Servo myservo; // create Servo object to control a servo
13+
// twelve Servo objects can be created on most boards
1414

1515
int pos = 0; // variable to store the servo position
1616

1717
void setup() {
18-
myservo.attach(9); // attaches the servo on pin 9 to the servo object
18+
myservo.attach(9); // attaches the servo on pin 9 to the Servo object
1919
}
2020

2121
void loop() {

0 commit comments

Comments
 (0)