MAV'RIC
Public Member Functions
Servo Class Reference

Driver for servomotors using PWM. More...

#include <servo.hpp>

List of all members.

Public Member Functions

 Servo (Pwm &pwm, const servo_conf_t config=servo_default_config_standard())
 Constructor.
bool init (void)
 Initializes the servo.
float read (void) const
 Returns the current servos value.
bool write (float value, bool to_hardware=true)
 Sets the servos to a given value.
bool failsafe (bool to_hardware=true)
 Sets the servos to failsafe value.
bool write_to_hardware (void)
 Set PWM line according to the servo value.
void calibrate_esc (void)
 Perform ESC calibration.
void set_servo_max (void)
 Sets the maximum value to the servo.
void set_servo_min (void)
 Sets the minimum value to the servo.
float servo_max (void)
 Gets the maximum value to the servo.
float servo_min (void)
 Gets the minimum value to the servo.

Detailed Description

Driver for servomotors using PWM.


Constructor & Destructor Documentation

Servo::Servo ( Pwm pwm,
const servo_conf_t  config = servo_default_config_standard() 
)

Constructor.

Parameters:
configConfiguration

Member Function Documentation

void Servo::calibrate_esc ( void  )

Perform ESC calibration.

DO NOT USE IN FLIGHT ! Set output to max for 2 seconds, then to failsafe value

Here is the call graph for this function:

bool Servo::failsafe ( bool  to_hardware = true)

Sets the servos to failsafe value.

Parameters:
to_hardwareIndicates if hardware peripheral should be updated (false by default)
Returns:
Success

Here is the call graph for this function:

Here is the caller graph for this function:

bool Servo::init ( void  )

Initializes the servo.

Returns:
success

Here is the call graph for this function:

Here is the caller graph for this function:

float Servo::read ( void  ) const

Returns the current servos value.

Returns:
Value
bool Servo::write ( float  value,
bool  to_hardware = true 
)

Sets the servos to a given value.

Parameters:
valueThe servo value to be set
to_hardwareIndicates if hardware peripheral should be updated (false by default)
Returns:
Success

Here is the call graph for this function:

Here is the caller graph for this function:

bool Servo::write_to_hardware ( void  )

Set PWM line according to the servo value.

Returns:
Success

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines