Class BO.io.Servo
Creates an interface to a Servo motor. Use this object to set the angle of the
servo head. You can simply specify and angle between 0 and 180 degrees and the
servo head will rotate to that angle. See Breakout/examples/actuators/servo.html for an
example application.
Defined in: Servo.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
BO.io.Servo(board, servoPin, minAngle, maxAngle)
Creates a new Servo
|
| Field Attributes | Field Name and Description |
|---|---|
|
Set the angle (in degrees) to rotate the server head to.
|
|
| <static> |
BO.io.Servo.COEF_TO_0_180
The scale to convert 0-1 (0-255 in 8bit) to 0-0.706 (0-180 in 8bit).
|
Class Detail
BO.io.Servo(board, servoPin, minAngle, maxAngle)
Creates a new Servo
- Parameters:
- {IOBoard} board
- A reference to the IOBoard instance that the servo is attached to.
- {Pin} servoPin
- A reference to the Pin the servo is connected to.
- {Number} minAngle
- The minimum angle the server can rotate to (default = 0).
- {Number} maxAngle
- The maximum angle the server can rotate to (default = 180).
Field Detail
{Number}
angle
Set the angle (in degrees) to rotate the server head to.
<static>
BO.io.Servo.COEF_TO_0_180
The scale to convert 0-1 (0-255 in 8bit) to 0-0.706 (0-180 in 8bit).
