Servo Class
Item Index
Methods
Servo
-
pin
Instantiates a Servo object
Parameters:
-
pin
NumberServo pin number
Returns:
Servo
-
pin
-
minPulseWidth
-
maxPulseWidth
Instantiates a Servo object
Parameters:
-
pin
NumberServo pin number
-
minPulseWidth
NumberMinimum pulse width, in microseconds
-
maxPulseWidth
NumberMaximum pulse width, in microseconds
Returns:
Servo
-
pin
-
minPulseWidth
-
maxPulseWidth
-
waitAndDisablePwm
Instantiates a Servo object
Parameters:
-
pin
NumberServo pin number
-
minPulseWidth
NumberMinimum pulse width, in microseconds
-
maxPulseWidth
NumberMaximum pulse width, in microseconds
-
waitAndDisablePwm
NumberIf 1, PWM is enabled only during the setAngle() execution for a period of 1 second, and then turned back off. If 0, PWM remains on afterward.
Returns:
setAngle
-
angle
Sets the angle of the servo engine.
Parameters:
-
angle
NumberNumber between 0 and 180
Returns:
0 if successful, non-zero otherwise
haltPwm
()
Mraa_result_t
Halts PWM for this servo and allows it to move freely.
Returns:
name
()
String
Returns the name of the component
Returns:
Name of the component
setMinPulseWidth
-
width
Sets the minimum pulse width
Parameters:
-
width
NumberMinimum HIGH signal width
setMaxPulseWidth
-
width
Sets the maximum pulse width
Parameters:
-
width
NumberMaximum HIGH signal width
setPeriod
-
period
Sets the maximum period width
Parameters:
-
period
NumberPWM period width
getMinPulseWidth
()
Number
Returns the minimum pulse width
Returns:
Minimum pulse width
getMaxPulseWidth
()
Number
Returns the maximum pulse width
Returns:
Maximum pulse width
getPeriod
()
Number
Returns the maximum PWM period width
Returns:
Maximum PWM period width