upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the ES08A Servo. More...

Detailed Description

This module defines the ES08A interface for ES08A servos. Like other servos, the ES08A servo has a shaft that can be controlled by setting the desired angle. There are also routines for setting and getting the minimum and maximum pulse width as well as the maximum period.

es08a.jpg
upm::ES08A servo(5);
// Sets the shaft to 180, then to 90, then to 0,
// then back to 90, and finally back to 180,
// pausing for a second in between each angle
servo.setAngle(180);
std::cout << "Set angle to 180" << std::endl;
upm_delay(1);
servo.setAngle(90);
std::cout << "Set angle to 90" << std::endl;
upm_delay(1);
servo.setAngle(0);
std::cout << "Set angle to 0" << std::endl;
upm_delay(1);
servo.setAngle(90);
std::cout << "Set angle to 90" << std::endl;
upm_delay(1);
servo.setAngle(180);
std::cout << "Set angle to 180" << std::endl;

Public Member Functions

 ES08A (int pin)
 
 ~ES08A ()
 
- Public Member Functions inherited from Servo
 Servo (int pin)
 
 Servo (int pin, int minPulseWidth, int maxPulseWidth)
 
 Servo (int pin, int minPulseWidth, int maxPulseWidth, int waitAndDisablePwm)
 
 ~Servo ()
 
mraa_result_t setAngle (int angle)
 
mraa_result_t haltPwm ()
 
std::string name ()
 
void setMinPulseWidth (int width)
 
void setMaxPulseWidth (int width)
 
void setPeriod (int period)
 
int getMinPulseWidth ()
 
int getMaxPulseWidth ()
 
int getPeriod ()
 

Additional Inherited Members

- Protected Member Functions inherited from Servo
int calcPulseTraveling (int value)
 
- Protected Attributes inherited from Servo
std::string m_name
 
int m_servoPin
 
float m_maxAngle
 
mraa_pwm_context m_pwmServoContext
 
int m_currAngle
 
int m_minPulseWidth
 
int m_maxPulseWidth
 
int m_period
 
int m_waitAndDisablePwm
 

Constructor & Destructor Documentation

ES08A ( int  pin)

Instantiates an ES08A object

Parameters
pinServo pin number
~ES08A ( )

ES08A object destructor

Inheritance diagram for ES08A:
Inheritance graph
[legend]
Collaboration diagram for ES08A:
Collaboration graph
[legend]

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