Kazutaka "Zak" Sawa / XBusServo

Dependents:   mbed_XBus_Test mbed_XBus_MotionTest XBusServoTest ControlYokutan2017_2 ... more

Embed: (wiki syntax)

« Back to documentation index

XBusServo Class Reference

XBusServo Class Reference

Library class for XBus servo. More...

#include <XBusServo.h>

Public Member Functions

 XBusServo (PinName tx, PinName rx, PinName sw, uint8_t maxServoNum)
XBusError start ()
 Start function to use XBus This should NOT be called on interrupt handler.
void stop ()
 Stop function to use XBus This should NOT be called on interrupt handler.
XBusError addServo (uint8_t channelID, uint16_t initValue)
 Add new servo to the buffer on this library This should NOT be called on interrupt handler when you setup the XBus servo.
XBusError removeServo (uint8_t channelID)
 Remove the servo from the buffer on this library This should NOT be called on interrupt handler when you setup the XBus servo.
XBusError setServo (uint8_t channelID, uint16_t value)
 Set new value to the servo This should NOT be called on interrupt handler when you setup the XBus servo.
void sendChannelDataPacket (void)
 This should be called on the timer handler when you use the XBus servo.
XBusError setChannelID (uint8_t oldChannelID, uint8_t newChannelID)
 Set new channel ID to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.
XBusError setCommand (uint8_t channelID, uint8_t order, int16_t *value)
 Send set command to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.
XBusError getCommand (uint8_t channelID, uint8_t order, int16_t *value)
 Send get command to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.
XBusError setChannelID (uint8_t newChannelID)
 Set new channel ID to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.
XBusError setCommand (uint8_t order, int16_t *value)
 Send set command to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.

Detailed Description

Library class for XBus servo.

Note:
2014/09/02 : move from Arduino lib by Sawa

Definition at line 111 of file XBusServo.h.


Constructor & Destructor Documentation

XBusServo ( PinName  tx,
PinName  rx,
PinName  sw,
uint8_t  maxServoNum 
)
Parameters:
txpin name for tx
rxpin name for rx
swpin name for switch tx
maxServoNummax number of servo that you want to connect. (limit 50) this does just to resetve the buffer. you need to add XBus servo at the beginning of your sketch
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 79 of file XBusServo.cpp.


Member Function Documentation

XBusError addServo ( uint8_t  channelID,
uint16_t  initValue 
)

Add new servo to the buffer on this library This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
channelIDchannel ID of the XBus servo that you want to use
initValueinitial value of this XBus servo use kXbusServoNeutral for center of the XBus servo
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 456 of file XBusServo.cpp.

XBusError getCommand ( uint8_t  channelID,
uint8_t  order,
int16_t *  value 
)

Send get command to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
channelIDchannel ID of the XBus servo that you want to get from
orderthe order that you want
valuethe value that you want to get from
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 728 of file XBusServo.cpp.

XBusError removeServo ( uint8_t  channelID )

Remove the servo from the buffer on this library This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
channelIDchannel ID of the XBus servo that you want to remove
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 510 of file XBusServo.cpp.

void sendChannelDataPacket ( void   )

This should be called on the timer handler when you use the XBus servo.

Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 326 of file XBusServo.cpp.

XBusError setChannelID ( uint8_t  newChannelID )

Set new channel ID to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
newChannelIDnew channel ID for the XBus servo
Note:
this is only for TX only mode
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 644 of file XBusServo.cpp.

XBusError setChannelID ( uint8_t  oldChannelID,
uint8_t  newChannelID 
)

Set new channel ID to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
oldChannelIDchannel IDof the XBus servo to change the ID
newChannelIDnew channel ID for the XBus servo
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 616 of file XBusServo.cpp.

XBusError setCommand ( uint8_t  order,
int16_t *  value 
)

Send set command to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
orderthe order that you want
valuethe value that you want to set and return current value
Note:
this is only for TX only mode
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 746 of file XBusServo.cpp.

XBusError setCommand ( uint8_t  channelID,
uint8_t  order,
int16_t *  value 
)

Send set command to the XBus servo This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
channelIDchannel ID of the XBus servo that you want to set to
orderthe order that you want
valuethe value that you want to set and return current value
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 710 of file XBusServo.cpp.

XBusError setServo ( uint8_t  channelID,
uint16_t  value 
)

Set new value to the servo This should NOT be called on interrupt handler when you setup the XBus servo.

Returns:
XBus error code
Parameters:
channelIDchannel ID of the XBus servo that you want to set
valuevalue of this XBus servo use kXbusServoNeutral for center of the XBus servo
Author:
2014/09/02 : move from Arduino lib by Zak Sawa

Definition at line 566 of file XBusServo.cpp.

XBusError start (  )

Start function to use XBus This should NOT be called on interrupt handler.

Returns:
XBus error code
Author:
2014/10/07 : Zak Sawa

Definition at line 116 of file XBusServo.cpp.

void stop (  )

Stop function to use XBus This should NOT be called on interrupt handler.

Author:
2014/10/07 : Zak Sawa

Definition at line 172 of file XBusServo.cpp.