discoverpixy
|
Data Structures | |
struct | Block |
Macros | |
#define | PIXY_MAX_SIGNATURE 7 |
#define | PIXY_MIN_X 0 |
#define | PIXY_MAX_X 319 |
#define | PIXY_MIN_Y 0 |
#define | PIXY_MAX_Y 199 |
#define | PIXY_RCS_MIN_POS 0 |
#define | PIXY_RCS_MAX_POS 1000 |
#define | PIXY_RCS_CENTER_POS ((PIXY_RCS_MAX_POS-PIXY_RCS_MIN_POS)/2) |
#define | PIXY_BLOCKTYPE_NORMAL 0 |
#define | PIXY_BLOCKTYPE_COLOR_CODE 1 |
Functions | |
int | pixy_init () |
Creates a connection with Pixy and listens for Pixy messages. More... | |
int | pixy_blocks_are_new () |
Indicates when new block data from Pixy is received. More... | |
int | pixy_get_blocks (uint16_t max_blocks, struct Block *blocks) |
Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'. More... | |
int | pixy_service () |
int | pixy_command (const char *name,...) |
Send a command to Pixy. More... | |
void | pixy_close () |
Terminates connection with Pixy. More... | |
void | pixy_error (int error_code) |
Send description of pixy error to stdout. More... | |
int | pixy_led_set_RGB (uint8_t red, uint8_t green, uint8_t blue) |
Set color of pixy LED. More... | |
int | pixy_led_set_max_current (uint32_t current) |
Set pixy LED maximum current. More... | |
int | pixy_led_get_max_current () |
Get pixy LED maximum current. More... | |
int | pixy_cam_set_auto_white_balance (uint8_t value) |
Enable or disable pixy camera auto white balance. More... | |
int | pixy_cam_get_auto_white_balance () |
Get pixy camera auto white balance setting. More... | |
uint32_t | pixy_cam_get_white_balance_value () |
Get pixy camera white balance() More... | |
int | pixy_cam_set_white_balance_value (uint8_t red, uint8_t green, uint8_t blue) |
Set pixy camera white balance. More... | |
int | pixy_cam_set_auto_exposure_compensation (uint8_t enable) |
Enable or disable pixy camera auto exposure compensation. More... | |
int | pixy_cam_get_auto_exposure_compensation () |
Get pixy camera auto exposure compensation setting. More... | |
int | pixy_cam_set_exposure_compensation (uint8_t gain, uint16_t comp) |
Set pixy camera exposure compensation. More... | |
int | pixy_cam_get_exposure_compensation (uint8_t *gain, uint16_t *comp) |
Get pixy camera exposure compensation. More... | |
int | pixy_cam_set_brightness (uint8_t brightness) |
Set pixy camera brightness. More... | |
int | pixy_cam_get_brightness () |
Get pixy camera brightness. More... | |
int | pixy_rcs_get_position (uint8_t channel) |
Get pixy servo axis position. More... | |
int | pixy_rcs_set_position (uint8_t channel, uint16_t position) |
Set pixy servo axis position. More... | |
int | pixy_rcs_set_frequency (uint16_t frequency) |
Set pixy servo pulse width modulation (PWM) frequency. More... | |
int | pixy_get_firmware_version (uint16_t *major, uint16_t *minor, uint16_t *build) |
Get pixy firmware version. More... | |
The Pixy Module
#define PIXY_RCS_CENTER_POS ((PIXY_RCS_MAX_POS-PIXY_RCS_MIN_POS)/2) |
int pixy_blocks_are_new | ( | ) |
Indicates when new block data from Pixy is received.
int pixy_cam_get_auto_exposure_compensation | ( | ) |
Get pixy camera auto exposure compensation setting.
int pixy_cam_get_auto_white_balance | ( | ) |
Get pixy camera auto white balance setting.
int pixy_cam_get_brightness | ( | ) |
Get pixy camera brightness.
int pixy_cam_get_exposure_compensation | ( | uint8_t * | gain, |
uint16_t * | comp | ||
) |
Get pixy camera exposure compensation.
[out] | gain | Camera gain. |
[out] | comp | Camera exposure compensation. |
uint32_t pixy_cam_get_white_balance_value | ( | ) |
Get pixy camera white balance()
int pixy_cam_set_auto_exposure_compensation | ( | uint8_t | enable | ) |
Enable or disable pixy camera auto exposure compensation.
[in] | enable | 0: Disable auto exposure compensation. 1: Enable auto exposure compensation. |
int pixy_cam_set_auto_white_balance | ( | uint8_t | value | ) |
Enable or disable pixy camera auto white balance.
value | 1: Enable white balance. 0: Disable white balance. |
int pixy_cam_set_brightness | ( | uint8_t | brightness | ) |
Set pixy camera brightness.
[in] | brightness | Brightness value. |
int pixy_cam_set_exposure_compensation | ( | uint8_t | gain, |
uint16_t | comp | ||
) |
Set pixy camera exposure compensation.
[in] | gain | Camera gain. |
[in] | comp | Camera exposure compensation. |
int pixy_cam_set_white_balance_value | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue | ||
) |
Set pixy camera white balance.
[in] | red | Red white balance value. |
[in] | green | Green white balance value. |
[in] | blue | Blue white balance value. |
void pixy_close | ( | ) |
Terminates connection with Pixy.
int pixy_command | ( | const char * | name, |
... | |||
) |
Send a command to Pixy.
[in] | name | Chirp remote procedure call identifier string. |
void pixy_error | ( | int | error_code | ) |
Send description of pixy error to stdout.
[in] | error_code | Pixy error code |
int pixy_get_blocks | ( | uint16_t | max_blocks, |
struct Block * | blocks | ||
) |
Copies up to 'max_blocks' number of Blocks to the address pointed to by 'blocks'.
[in] | max_blocks | Maximum number of Blocks to copy to the address pointed to by 'blocks'. |
[out] | blocks | Address of an array in which to copy the blocks to. The array must be large enough to write 'max_blocks' number of Blocks to. |
int pixy_get_firmware_version | ( | uint16_t * | major, |
uint16_t * | minor, | ||
uint16_t * | build | ||
) |
Get pixy firmware version.
[out] | major | Major version component |
[out] | minor | Minor version component |
[out] | build | Build identifier |
int pixy_init | ( | ) |
Creates a connection with Pixy and listens for Pixy messages.
int pixy_led_get_max_current | ( | ) |
Get pixy LED maximum current.
int pixy_led_set_max_current | ( | uint32_t | current | ) |
Set pixy LED maximum current.
[in] | current | Maximum current (microamps). |
int pixy_led_set_RGB | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue | ||
) |
Set color of pixy LED.
[in] | red | Brightness value for red LED element. [0, 255] 0 = Off, 255 = On |
[in] | green | Brightness value for green LED element. [0, 255] 0 = Off, 255 = On |
[in] | blue | Brightness value for blue LED element. [0, 255] 0 = Off, 255 = On |
int pixy_rcs_get_position | ( | uint8_t | channel | ) |
Get pixy servo axis position.
channel | Channel value. Range: [0, 1] |
int pixy_rcs_set_frequency | ( | uint16_t | frequency | ) |
Set pixy servo pulse width modulation (PWM) frequency.
frequency | Range: [20, 300] Hz Default: 50 Hz |
int pixy_rcs_set_position | ( | uint8_t | channel, |
uint16_t | position | ||
) |
Set pixy servo axis position.
channel | Channel value. Range: [0, 1] |
position | Position value of the channel. Range: [0, 999] |
int pixy_service | ( | ) |