Skip to content

Commit a5a1fdf

Browse files
committed
Update all Multimedia
1 parent 1a59aee commit a5a1fdf

11 files changed

+2948
-3852
lines changed

source/API_Documents/Analog/Class AmebaServo.rst

Lines changed: 44 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ A class used for controlling servo motors connected to Ameba boards.
1616
**Syntax**
1717
~~~~~~~~~~
1818

19-
```
20-
class AmebaServo
21-
```
19+
.. code-block:: c++
20+
21+
class AmebaServo
2222

2323
**Members**
2424
~~~~~~~~~~~
@@ -61,19 +61,19 @@ Attach a PWM pin to control servo on Ameba boards. Minimum and maximum pulse wid
6161
**Syntax**
6262
~~~~~~~~~~
6363

64-
```
65-
uint8_t attach(int pin);
66-
uint8_t attach(int pin, int min, int max);
67-
```
64+
.. code-block:: c++
65+
66+
uint8_t attach(int pin);
67+
uint8_t attach(int pin, int min, int max);
6868

6969
**Parameters**
7070
~~~~~~~~~~~~~~
7171

7272
pin: A PWM pin that is one of the Ameba boards' PWM pins.
7373

74-
min: Minimum pulse width to be set for PWM. By default, the min is 544us.
74+
min: Minimum pulse width to be set for PWM. Default value is 544us.
7575

76-
max: Maximum pulse width to be set for PWM. By default, the max is 2400us.
76+
max: Maximum pulse width to be set for PWM. Default value is 2400us.
7777

7878
**Returns**
7979
~~~~~~~~~~~
@@ -82,14 +82,12 @@ max: Maximum pulse width to be set for PWM. By default, the max is 2400us.
8282
**Example Code**
8383
~~~~~~~~~~~~~~~~
8484

85-
Example: [ServoSweep](https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino)
85+
Example: `ServoSweep <https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino>`_
8686

87-
The code demonstrates a servo motor sweeping from 0 - 180 - 0 degrees, in 1-degree intervals.
8887

89-
**Notes and Warnings**
90-
~~~~~~~~~~~~~~~~~~~~~~
88+
The code demonstrates a servo motor sweeping from 0 - 180 - 0 degrees, in 1-degree intervals.
9189

92-
“AmebaServo.h” must be included to use the class function.
90+
.. note :: “AmebaServo.h” must be included to use the class function.
9391
9492
**AmebaServo::detach**
9593
----------------------
@@ -102,9 +100,9 @@ Detach the servo by disabling the PWM pin previously set in attach().
102100
**Syntax**
103101
~~~~~~~~~~
104102

105-
```
106-
void detach(void);
107-
```
103+
.. code-block:: c++
104+
105+
void detach(void);
108106

109107
**Parameters**
110108
~~~~~~~~~~~~~~
@@ -121,10 +119,7 @@ NA
121119

122120
NA
123121

124-
**Notes and Warnings**
125-
~~~~~~~~~~~~~~~~~~~~~~
126-
127-
“AmebaServo.h” must be included to use the class function.
122+
.. note :: “AmebaServo.h” must be included to use the class function.
128123
129124
**AmebaServo::write**
130125
---------------------
@@ -137,14 +132,16 @@ Write an integer value to control servo. The value is between 0 - 180 degrees.
137132
**Syntax**
138133
~~~~~~~~~~
139134

140-
```
141-
void write(int value);
142-
```
135+
.. code-block:: c++
136+
137+
void write(int value);
143138

144139
**Parameters**
145140
~~~~~~~~~~~~~~
146141

147-
value: An integer value that should be between 0 - 180. If the value is < 0, it will be taken as 0 and if the value >180, it will be taken as 180.
142+
value: An integer value.
143+
144+
- 0 to 180 (If the value is < 0, it will be taken as 0 and if the value >180, it will be taken as 180)
148145

149146
**Returns**
150147
~~~~~~~~~~~
@@ -153,12 +150,9 @@ NA
153150

154151
**Example Code**
155152
~~~~~~~~~~~~~~~~
156-
Example: [ServoSweep](https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino)
157-
158-
**Notes and Warnings**
159-
~~~~~~~~~~~~~~~~~~~~~~
153+
Example: `ServoSweep <https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino>`_
160154

161-
“AmebaServo.h” must be included to use the class function.
155+
.. note :: “AmebaServo.h” must be included to use the class function.
162156
163157
**AmebaServo::writeMicroseconds**
164158
---------------------------------
@@ -171,14 +165,16 @@ Write a value to control servo. The value is between 544 - 2400us that represent
171165
**Syntax**
172166
~~~~~~~~~~
173167

174-
```
175-
void writeMicroseconds(int value);
176-
```
168+
.. code-block:: c++
169+
170+
void writeMicroseconds(int value);
177171

178172
**Parameters**
179173
~~~~~~~~~~~~~~
180174

181-
value: An integer value that should be between 544 - 2400us as pulse width. If the value is < 544us, it will be taken as 544us and if the value > 2400us, it will be taken as 2400us.
175+
value: An integer value (us) as pulse width.
176+
177+
- 544 to 2400 (If the value is < 544, it will be taken as 544 and if the value > 2400, it will be taken as 2400)
182178

183179
**Returns**
184180
~~~~~~~~~~~
@@ -190,10 +186,7 @@ NA
190186

191187
NA
192188

193-
**Notes and Warnings**
194-
~~~~~~~~~~~~~~~~~~~~~~
195-
196-
“AmebaServo.h” must be included to use the class function.
189+
.. note :: “AmebaServo.h” must be included to use the class function.
197190
198191
**AmebaServo::read**
199192
--------------------
@@ -206,9 +199,9 @@ The function reads the value from servo and returns current pulse width as an an
206199
**Syntax**
207200
~~~~~~~~~~
208201

209-
```
210-
int read(void);
211-
```
202+
.. code-block:: c++
203+
204+
int read(void);
212205

213206
**Parameters**
214207
~~~~~~~~~~~~~~
@@ -225,10 +218,7 @@ This function returns integer value that represents pulse width between 0 - 180
225218

226219
NA
227220

228-
**Notes and Warnings**
229-
~~~~~~~~~~~~~~~~~~~~~~
230-
231-
“AmebaServo.h” must be included to use the class function.
221+
.. note :: “AmebaServo.h” must be included to use the class function.
232222
233223
**AmebaServo::readMicroseconds**
234224
--------------------------------
@@ -241,9 +231,9 @@ The function reads and returns the pulse width of the current servo in microseco
241231
**Syntax**
242232
~~~~~~~~~~
243233

244-
```
245-
int readMicroseconds(void);
246-
```
234+
.. code-block:: c++
235+
236+
int readMicroseconds(void);
247237

248238
**Parameters**
249239
~~~~~~~~~~~~~~
@@ -260,10 +250,7 @@ This function returns an integer value that represents pulse width in microsecon
260250

261251
NA
262252

263-
**Notes and Warnings**
264-
~~~~~~~~~~~~~~~~~~~~~~
265-
266-
“AmebaServo.h” must be included to use the class function.
253+
.. note :: “AmebaServo.h” must be included to use the class function.
267254
268255
**AmebaServo::attached**
269256
------------------------
@@ -276,9 +263,9 @@ Check if the servo PWM pin is attached successfully.
276263
**Syntax**
277264
~~~~~~~~~~
278265

279-
```
280-
bool attached(void);
281-
```
266+
.. code-block:: c++
267+
268+
bool attached(void);
282269

283270
**Parameters**
284271
~~~~~~~~~~~~~~
@@ -292,8 +279,6 @@ This function returns 1 if the servo has been attached, else it returns 0.
292279

293280
**Example Code**
294281
~~~~~~~~~~~~~~~~
295-
Example: [ServoSweep](https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino)
282+
Example: `ServoSweep <https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/libraries/Analog/examples/ServoSweep/ServoSweep.ino>`_
296283

297-
**Notes and Warnings**
298-
~~~~~~~~~~~~~~~~~~~~~~
299-
“AmebaServo.h” must be included to use the class function.
284+
.. note :: “AmebaServo.h” must be included to use the class function.

0 commit comments

Comments
 (0)