B4J Programming Press on the image to return to the main documentation page.

rServo

List of types:

Servo

Servo


Events:

None

Members:


  Attach (Pin As Int) As Byte

  Attach2 (Pin As Int, MinValue As Int, MaxValue As Int) As Byte

  Attached As Boolean [read only]

  Detach As void

  Read As Int

  ReadMicroseconds As Int

  Write (Value As Int) As void

  WriteMicroseconds (Value As Int) As void

Members description:

Attach (Pin As Int) As Byte
Attaches the servo to the specified pin.
Returns 0 if there was a failure.
Note that on most boards, adding a servo the PWM feature of pins 9 and 10.
Attach2 (Pin As Int, MinValue As Int, MaxValue As Int) As Byte
Attaches the servo to the specified pin.
Returns 0 if there was a failure.
MinValue and MaxValue set the minimum and maximum pulse width that will be sent to the servo.
Attached As Boolean [read only]
Returns true if the servo is attached.
Detach As void
Detaches the pin.
Read As Int
Returns current pulse width as an angle between 0 to 180 degrees.
ReadMicroseconds As Int
Returns current pulse width in microseconds.
Write (Value As Int) As void
If the value is smaller than 200 then it is treated as an angle.
Otherwise it is treated as pulse width in microseconds.
WriteMicroseconds (Value As Int) As void
Writes pulse width in microseconds.
Top