|
direcs
2012-09-30
|
This class controls connected servos. More...
#include <servo.h>

Public Slots | |
| void | init (void) |
| bool | moveServo (unsigned char servo, unsigned char position) |
| void | setRobotState (bool state) |
Signals | |
| void | message (QString text) |
Public Member Functions | |
| unsigned char | getServoPosition (int servo, unsigned char type=SVCURRENT) |
| Servo (InterfaceAvr *i, QMutex *m) | |
| void | setServoPosition (int servo, unsigned char type, unsigned char position) |
| ~Servo () | |
Private Attributes | |
| QString | className |
| InterfaceAvr * | interface1 |
| QMutex * | mutex |
| this will contain the name of this class at runtime. | |
| bool | robotState |
| int | servoDefaultPosition [NUMBEROFSERVOS] |
| int | servoEndPosition [NUMBEROFSERVOS] |
| int | servoMaxPosition [NUMBEROFSERVOS] |
| int | servoMinPosition [NUMBEROFSERVOS] |
| int | servoPosition [NUMBEROFSERVOS] |
| int | servoStartPosition [NUMBEROFSERVOS] |
Static Private Attributes | |
| static const unsigned char | NUMBEROFSERVOS = 6 |
| defines the size of the servo[] arrays. | |
| static const bool | OFF = false |
| static const bool | ON = true |
| the current position of the servo! | |
| static const unsigned char | SERVO1 = 0 |
| the servo numbers | |
| static const unsigned char | SERVO2 = 1 |
| static const unsigned char | SERVO3 = 2 |
| static const unsigned char | SERVO4 = 3 |
| static const unsigned char | SERVO5 = 4 |
| static const unsigned char | SERVO6 = 5 |
| static const unsigned char | SET_SERVO1 = 42 |
| the command for the microcontroller | |
| static const unsigned char | SET_SERVO2 = 43 |
| static const unsigned char | SET_SERVO3 = 44 |
| static const unsigned char | SET_SERVO4 = 45 |
| static const unsigned char | SET_SERVO5 = 46 |
| static const unsigned char | SET_SERVO6 = 47 |
| static const unsigned char | SVCURRENT = 3 |
| static const unsigned char | SVDEFAULT = 2 |
| static const unsigned char | SVEND = 1 |
| static const unsigned char | SVMAX = 5 |
| static const unsigned char | SVMIN = 4 |
| static const unsigned char | SVSTART = 0 |
| the possible servo data | |
| static const unsigned long | THREADSLEEPTIME = 100 |
This class controls connected servos.
| Servo::Servo | ( | InterfaceAvr * | i, |
| QMutex * | m | ||
| ) |
| unsigned char Servo::getServoPosition | ( | int | servo, |
| unsigned char | type = SVCURRENT |
||
| ) |
Returns the servo start, end, default or current position.
| servo | is the servo number. |
| type | can be SVMIN, SVMAX, SVSTART, SVEND, SVDEFAULT or SVCURRENT=default |
Definition at line 171 of file servo.cpp.


|
slot |
|
signal |
Emits a message to be displayed in the GUI or be used somewhere else (e.g. error message).

|
slot |
|
slot |
| void Servo::setServoPosition | ( | int | servo, |
| unsigned char | type, | ||
| unsigned char | position | ||
| ) |
|
private |
|
mutableprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |