Servo.write

Name
servo.write

Description
This function sets a servo position to the degrees position specified by argument 'position'.


 * Since: Beta 32X, releasee 323.


 * Warning!: Servo library uses PIC's Timer1 (TMR1). So, be aware of that in case you plan to use a timer in your application. Otherwise you could disrupt servo library.

Syntax

 * pin : Value: Check valid values according to board : [Servo library supported boards]
 * Argument type: unsigned char


 * position: Valid values are from 0 to 180 degrees.
 * Argument type: unsigned char


 * Output: None

Example
The following example defines pin 15 as servo driver.

In the loop, position of servo-pin 15 will be modified 1 degree every half second. Once reached 180 degrees position it will return to 0 degrees position.

Connectivity diagram is shown within the code comments.