pixy2 smart camera library www.pixycam.com
Pixy2 Library project (using UART interface)
Diff: pixy2.h
- Revision:
- 4:eed638064b42
- Parent:
- 3:6ba43af28440
- Child:
- 5:28e47187bb5c
--- a/pixy2.h Mon Mar 11 14:54:44 2019 +0000 +++ b/pixy2.h Mon Mar 11 15:21:33 2019 +0000 @@ -240,6 +240,7 @@ * \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 This structure is a feature of Line API, packed as a feature in a Line Frame, documented here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:protocol_reference * @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 */ @@ -258,6 +259,7 @@ * \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 This structure is a sub feature of Line API, packed as a sub feature of intersection feature in a Line Frame, documented here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:protocol_reference * @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 */ @@ -274,6 +276,7 @@ * \param pixY (Byte) : Y axis coordinate of the intersection (in pixel, between 0 and 51) * \param pixN (Byte) : Number of lines connected to the intersection (between 3 and 5) * \param pixReserved (Byte) : Not documented by manufacturer + * @note This structure is a feature of Line API, packed as a feature in a Line Frame, documented here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:protocol_reference * @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 */ @@ -291,6 +294,7 @@ * \param pixY (Byte) : Y axis coordinate of the barcode (in pixel, between 0 and 51) * \param pixFlag (Byte) : Flag to indicate if barcode met filtering constraint * \param pixCode (Byte) : Indicate the numeric value associated with the barcode (between 0 and 15) + * @note This structure is a feature of Line API, packed as a feature in a Line Frame, documented here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:protocol_reference * @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 */ @@ -301,11 +305,29 @@ Byte pixCode; }T_pixy2BarCode; +/** + * \struct T_pixy2LineFeature + * \brief Structured type that match pixy2 feature header for Line API - used in Line frame (type 48/49) - message payload + * \param pixType (Byte) : Type of the feature (can be 1 -> Vector, 2 -> Intersection or 4 -> Barcode) + * \param pixLength (Byte) : Number of Bytes for this feature + * @note This structure is the header of features of Line API in Line Frames. Ther can be up to 4 features in a frame. Documented here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:protocol_reference + * @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 pixType; Byte pixLength; }T_pixy2LineFeature; +/** + * \struct T_pixy2Pixel + * \brief Structured type that match pixy2 video API - used in Video frame (type 112/1) - message payload + * \param pixBlue (Byte) : Blue RGB value of the average blue component of the 5x5 pixels square centered on X param passes to the function (value between 0 and 255) + * \param pixGreen (Byte) : Green RGB value of the average blue component of the 5x5 pixels square centered on X param passes to the function (value between 0 and 255) + * \param pixRed (Byte) : Red RGB value of the average blue component of the 5x5 pixels square centered on X param passes to the function (value between 0 and 255) + * @note More info can be found here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:video_api + * @note or here : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:video + */ typedef struct { Byte pixBlue; Byte pixGreen; @@ -344,6 +366,16 @@ * @return -7 if Type Error */ int pixy2_getVersion (T_Pixy2Version *version); + +/** + * Gives information about Pixy2 Resolution + * @note according to documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide + * @param version (T_Pixy2Resolution - passed by reference) : pointer to the resolution data + * @return 0 if OK + * @return -2 if Busy + * @return -3 if Checksum error + * @return -7 if Type Error + */ int pixy2_getResolution (T_Pixy2Resolution *resolution); int pixy2_setCameraBrightness (Byte brightness); int pixy2_setServos (Word s0, Word s1);