pixy2 smart camera library www.pixycam.com
Pixy2 Library project (using UART interface)
Diff: pixy2.h
- Revision:
- 2:5281a6289e8b
- Parent:
- 1:dd81f4065b6b
- Child:
- 3:6ba43af28440
--- a/pixy2.h Thu Feb 28 11:13:47 2019 +0000 +++ b/pixy2.h Fri Mar 01 13:25:12 2019 +0000 @@ -76,12 +76,18 @@ /** * \struct Byte -> Short hand for unsigned char + * \struct sByte -> Short hand for char * \struct Word -> Short hand for unsigned short + * \struct sWord -> Short hand for short * \struct lWord -> Short hand for unsigned long + * \struct slWord -> Short hand for long */ typedef unsigned char Byte; +typedef char sByte; typedef unsigned short Word; +typedef short sWord; typedef unsigned long lWord; +typedef long slWord; /** * \union T_Word @@ -208,7 +214,7 @@ * \param pixY (Word) : 16 bits Y (vertical axis) position of color bloc center, relative to the top of the image (in pixels, between 0 and 207) * \param pixWidth (Word) : 16 bits width (in pixels, between 0 and 316) of color bloc * \param pixHeight (Word) : 16 bits height (in pixels, between 0 and 208) of color bloc - * \param pixAngle (Word) : 16 bits angle (in degree, between -180.0 and +180.0) of a color code bloc + * \param pixAngle (sWord) : 16 bits angle (in degree, between -180.0 and +180.0) of a color code bloc * \param pixIndex (Byte) : 8 bits tracking identification of the color code bloc (set by pixy2 to ease a bloc position following program) * \param pixAge (Byte) : 8 bits age (in number of frame) of a bloc (doesn't wrap around). * @note More info can be found here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:ccc_api @@ -220,7 +226,7 @@ Word pixY; Word pixWidth; Word pixHeight; - Word pixAngle; + sWord pixAngle; Byte pixIndex; Byte pixAge; }T_pixy2Bloc; @@ -228,12 +234,14 @@ /** * \struct T_Pixy2Vector * \brief Structured type that match pixy2 vector definition - used in Line frame (type 48/49) - message payload - * \param pixX0 (Byte) : 8 bits X (horizontal, relative to the left of image) position of color bloc center - * \param pixY0 (Byte) : 8 bits Y (vertical, relative to the top of image) position of color bloc center - * \param pixX1 (Byte) : 8 bits width (in pixels) of color bloc - * \param pixY1 (Byte) : 8 bits height (in pixels) of color bloc - * \param pixIndex (Byte) : 8 bits identification of the color code bloc (used to follow a bloc position) - * \param pixAge (Byte) : 8 bits age (in number of frame) of a bloc (doesn't wrap around) (used to follow a bloc position) + * \param pixX0 (Byte) : 8 bits X (horizontal, relative to the left of image) position of the tail of the vector (number between 0 and 78) + * \param pixY0 (Byte) : 8 bits Y (vertical, relative to the top of image) position of the tail of the vector (number between 0 and 51) + * \param pixX1 (Byte) : 8 bits X (horizontal, relative to the left of image) position of the head of the vector (number between 0 and 78) + * \param pixY1 (Byte) : 8 bits Y (vertical, relative to the top of image) position of the head of the vector (number between 0 and 51) + * \param pixIndex (Byte) : 8 bits tracking identification of the vector (set by pixy2 to ease a vector identification in case of multiple vector in a line following program) + * \param pixFlags (Byte) : 8 bits flag containing possible usefull informations (see notes) + * @note More info can be found here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_api + * @note or here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_tracking */ typedef struct { Byte pixX0; @@ -244,10 +252,19 @@ Byte pixFlags; }T_Pixy2Vector; +/** + * \struct T_Pixy2InterLine + * \brief Structured type that match pixy2 intersection line definition - used in Line frame (type 48/49) - message payload + * \param pixIndex (Byte) : 8 bits tracking identification of the intersection line (set by pixy2 to ease a line following program) + * \param pixReserved (Byte) : Not documented by manufacturer + * \param pixAngle (sWord) : 16 bits angle (in degree, between -180.0 and +180.0) of the intersection line + * @note More info can be found here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_api + * @note or here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_tracking + */ typedef struct { Byte pixIndex; Byte pixReserved; - Word pixAngle; + sWord pixAngle; }T_Pixy2InterLine; typedef struct {