mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
doxygen: Added documentation for servo base and es08a
Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
This commit is contained in:
parent
1ff0e5ee57
commit
814cc4a0e8
@ -43,6 +43,7 @@ sig_handler(int signo)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
//! [Interesting]
|
||||||
upm::ES08A *servo = new upm::ES08A(5);
|
upm::ES08A *servo = new upm::ES08A(5);
|
||||||
|
|
||||||
signal(SIGINT, sig_handler);
|
signal(SIGINT, sig_handler);
|
||||||
@ -59,6 +60,7 @@ main(int argc, char **argv)
|
|||||||
clock -= 10;
|
clock -= 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//! [Interesting]
|
||||||
|
|
||||||
std::cout << "exiting application" << std::endl;
|
std::cout << "exiting application" << std::endl;
|
||||||
|
|
||||||
|
@ -31,9 +31,26 @@ namespace upm {
|
|||||||
#define MIN_PULSE_WIDTH 600
|
#define MIN_PULSE_WIDTH 600
|
||||||
#define MAX_PULSE_WIDTH 2500
|
#define MAX_PULSE_WIDTH 2500
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief C++ API for ES08A servo component
|
||||||
|
*
|
||||||
|
* This file defines the ES08A C++ interface for libes08a
|
||||||
|
*
|
||||||
|
* @snippet es08a.cxx Interesting
|
||||||
|
*
|
||||||
|
*/
|
||||||
class ES08A : public Servo {
|
class ES08A : public Servo {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Instanciates a ES08A object
|
||||||
|
*
|
||||||
|
* @param pin servo pin number
|
||||||
|
*/
|
||||||
ES08A (int pin);
|
ES08A (int pin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ES08A object destructor.
|
||||||
|
*/
|
||||||
~ES08A ();
|
~ES08A ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,12 +35,46 @@ namespace upm {
|
|||||||
#define HIGH 1
|
#define HIGH 1
|
||||||
#define LOW 0
|
#define LOW 0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Base class for other servo components
|
||||||
|
*
|
||||||
|
* PMOD pins for MAX44000PMB1 board
|
||||||
|
*
|
||||||
|
*/
|
||||||
class Servo {
|
class Servo {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Instanciates a servo object
|
||||||
|
*
|
||||||
|
* @param pin servo pin number
|
||||||
|
*/
|
||||||
Servo (int pin);
|
Servo (int pin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Servo object destructor.
|
||||||
|
*/
|
||||||
~Servo();
|
~Servo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the of the servo engine.
|
||||||
|
*
|
||||||
|
* X = between (MIN_PULSE_WIDTH , MAX_PULSE_WIDTH)
|
||||||
|
*
|
||||||
|
* X usec
|
||||||
|
* _______
|
||||||
|
* |_______________________________________
|
||||||
|
* 20000 usec
|
||||||
|
*
|
||||||
|
* Max period can be only 7968750(nses) which is ~8(msec)
|
||||||
|
* so the servo will not work as expected.
|
||||||
|
*
|
||||||
|
* @param angle number between 0 and 180
|
||||||
|
*/
|
||||||
maa_result_t setAngle (int angle);
|
maa_result_t setAngle (int angle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return name of the component
|
||||||
|
*/
|
||||||
std::string name()
|
std::string name()
|
||||||
{
|
{
|
||||||
return m_name;
|
return m_name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user