upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members
Servo Class Reference

Public Member Functions

synchronized void delete ()
 
 Servo (int pin)
 
 Servo (int pin, int minPulseWidth, int maxPulseWidth)
 
 Servo (int pin, int minPulseWidth, int maxPulseWidth, int waitAndDisablePwm)
 
int setAngle (int angle)
 
int haltPwm ()
 
String name ()
 
void setMinPulseWidth (int width)
 
void setMaxPulseWidth (int width)
 
void setPeriod (int period)
 
int getMinPulseWidth ()
 
int getMaxPulseWidth ()
 
int getPeriod ()
 

Constructor & Destructor Documentation

Servo ( int  pin)

Instantiates a Servo object

Parameters
pinServo pin number
Servo ( int  pin,
int  minPulseWidth,
int  maxPulseWidth 
)

Instantiates a Servo object

Parameters
pinServo pin number
minPulseWidthMinimum pulse width, in microseconds
maxPulseWidthMaximum pulse width, in microseconds
Servo ( int  pin,
int  minPulseWidth,
int  maxPulseWidth,
int  waitAndDisablePwm 
)

Instantiates a Servo object

Parameters
pinServo pin number
minPulseWidthMinimum pulse width, in microseconds
maxPulseWidthMaximum pulse width, in microseconds
waitAndDisablePwmIf 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.

Member Function Documentation

int getMaxPulseWidth ( )

Returns the maximum pulse width

Returns
Maximum pulse width
int getMinPulseWidth ( )

Returns the minimum pulse width

Returns
Minimum pulse width
int getPeriod ( )

Returns the maximum PWM period width

Returns
Maximum PWM period width
int haltPwm ( )

Halts PWM for this servo and allows it to move freely.

String name ( )

Returns the name of the component

Returns
Name of the component
int setAngle ( int  angle)

Sets the angle of the servo engine.

Parameters
angleNumber between 0 and 180
Returns
0 if successful, non-zero otherwise
void setMaxPulseWidth ( int  width)

Sets the maximum pulse width

Parameters
widthMaximum HIGH signal width
void setMinPulseWidth ( int  width)

Sets the minimum pulse width

Parameters
widthMinimum HIGH signal width
void setPeriod ( int  period)

Sets the maximum period width

Parameters
periodPWM period width
Inheritance diagram for Servo:
Inheritance graph
[legend]

The documentation for this class was generated from the following file: