HerkuleXLib
1.1
Arduino library to drive HerkuleX DRS-0101 and DRS-0201
|
Class to manage unit conversions. More...
#include <HkxCommunication.h>
Static Public Member Functions | |
static int16_t | voltageRawToValue (uint8_t voltageRaw) |
Voltage from raw to value. More... | |
static uint8_t | voltageValueToRaw (int16_t voltageValue) |
Voltage from value to raw. More... | |
static int16_t | temperatureRawToValue (uint8_t temperatureRaw) |
Temperature from raw to value. More... | |
static uint8_t | temperatureValueToRaw (int16_t temperatureValue) |
Temperature from value to raw. More... | |
static int16_t | angleRawToValue (int16_t angleRaw) |
Angle from raw to value. More... | |
static int16_t | angleValueToRaw (int16_t angleValue) |
Angle from value to raw. More... | |
static int16_t | positionRawToValue (uint16_t positionRaw) |
Position from raw to value. More... | |
static uint16_t | positionValueToRaw (int16_t positionValue) |
Position from value to raw. More... | |
static int16_t | velocityRawToValue (int16_t velocityRaw) |
Velocity from raw to value. More... | |
static int16_t | velocityValueRaw (int16_t velocityValue) |
Velocity from value to raw. More... | |
static uint16_t | timeRawToValue (uint8_t timeRaw) |
Time from raw to value. More... | |
static uint8_t | timeValueToRaw (uint16_t timeValue) |
Time from value to raw. More... | |
static uint16_t | slopeRawToValue (uint16_t slopeRaw) |
Slope from raw to value. More... | |
static uint16_t | slopeValueToRaw (uint16_t slopeValue) |
Slope from value to raw. More... | |
static hkxBaudrate | baudrateRawToValue (uint8_t baudrateRaw) |
Baud rate from raw to value. More... | |
static uint8_t | baudrateValueToRaw (hkxBaudrate baudrate) |
Baud rate from value to raw. More... | |
Class to manage unit conversions.
This class manages the unit conversions between raw values as sent by the servo and physical quantity.
|
inlinestatic |
Angle from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the angle.
[in] | angleRaw | : angle in raw unit. |
|
inlinestatic |
Angle from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the angle.
[in] | angleValue | : angle in 10^-1 degrees. |
|
inlinestatic |
Baud rate from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the baud rate.
--------------------------------------------------------------------------------------------------------- | hkxBaudrate | HKX_57600 | HKX_115200 | HKX_200000 | HKX_250000 | HKX_400000 | HKX_500000 | HKX_666666 | --------------------------------------------------------------------------------------------------------- | baud rate | 57600 | 115200 | 200000 | 250000 | 400000 | 500000 | 666666 | --------------------------------------------------------------------------------------------------------- | raw value | 0x22 | 0x10 | 0x09 | 0x07 | 0x04 | 0x03 | 0x02 | ---------------------------------------------------------------------------------------------------------
[in] | baudrateRaw | : baudrateRaw in raw unit. |
|
inlinestatic |
Baud rate from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the baud rate.
--------------------------------------------------------------------------------------------------------- | hkxBaudrate | HKX_57600 | HKX_115200 | HKX_200000 | HKX_250000 | HKX_400000 | HKX_500000 | HKX_666666 | --------------------------------------------------------------------------------------------------------- | baud rate | 57600 | 115200 | 200000 | 250000 | 400000 | 500000 | 666666 | --------------------------------------------------------------------------------------------------------- | raw value | 0x22 | 0x10 | 0x09 | 0x07 | 0x04 | 0x03 | 0x02 | ---------------------------------------------------------------------------------------------------------
[in] | baudrate | : baud rate in bps (bytes per second). |
|
inlinestatic |
Position from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the angle position. The angle position refers to the figure p.32 of the user manual: 512 (raw) = 0°, 0 (raw) = -166.7°, 1023 (raw) = 166.7°.
[in] | positionRaw | : position in raw unit. |
|
inlinestatic |
Position from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the angle position. The angle position refers to the figure p.32 of the user manual: 512 (raw) = 0°, 0 (raw) = -166.7°, 1023 (raw) = 166.7°.
[in] | positionValue | : position in 10^-1 degrees (reference to the central position). |
|
inlinestatic |
Slope from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the PWM/angle slope.
[in] | slopeRaw | : slope in raw unit. |
|
inlinestatic |
Slope from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the PWM/angle slope.
[in] | slopeValue | : slope in 10^-2 PWM/degree. |
|
inlinestatic |
Temperature from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the temperature. See the conversion table p.55 of the user manual for more details.
[in] | temperatureRaw | : temperature in raw unit. |
|
inlinestatic |
Temperature from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the temperature. See the conversion table p.55 of the user manual for more details.
[in] | temperatureValue | : temperature 10^-2 °C (degree Celsius). |
|
inlinestatic |
Time from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the time.
[in] | timeRaw | : time in raw unit. |
|
inlinestatic |
Time from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the time.
[in] | timeValue | : time in degrees/second. |
|
inlinestatic |
Velocity from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the angle velocity.
[in] | velocityRaw | : velocity in raw unit. |
|
inlinestatic |
Velocity from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the angle velocity.
[in] | velocityValue | : velocity in degrees/second. |
|
inlinestatic |
Voltage from raw to value.
Conversion from raw (servo unit) to value (physical quantity) of the voltage.
[in] | voltageRaw | : voltage in raw unit. |
|
inlinestatic |
Voltage from value to raw.
Conversion from value (physical quantity) to raw (servo unit) of the voltage.
[in] | voltageValue | : voltage in millivolts. |