Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 11:68ef9f85e40e, committed 2019-03-12
- Comitter:
- haarkon
- Date:
- Tue Mar 12 14:16:53 2019 +0000
- Parent:
- 10:ea759846c2d5
- Child:
- 12:7493191dd1dc
- Commit message:
- updated error hndling
Changed in this revision
| pixy2.cpp | Show annotated file Show diff for this revision Revisions of this file |
| pixy2.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/pixy2.cpp Tue Mar 12 14:06:53 2019 +0000
+++ b/pixy2.cpp Tue Mar 12 14:16:53 2019 +0000
@@ -65,7 +65,7 @@
}
}
-Pixy2ErrorCode PIXY2::pixy2_sndGetVersion (void){
+T_pixy2ErrorCode PIXY2::pixy2_sndGetVersion (void){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 0;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -79,7 +79,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndGetResolution (void){
+T_pixy2ErrorCode PIXY2::pixy2_sndGetResolution (void){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 1;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -94,7 +94,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetCameraBrightness (Byte brightness){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetCameraBrightness (Byte brightness){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 1;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -109,7 +109,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetServo (Word s0, Word s1){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetServo (Word s0, Word s1){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 4;
T_Word tmp;
@@ -130,7 +130,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetLED (Byte red, Byte green, Byte blue){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetLED (Byte red, Byte green, Byte blue){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 3;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -147,7 +147,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetLamp (Byte upper, Byte lower){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetLamp (Byte upper, Byte lower){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 2;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -163,7 +163,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndGetFPS (void){
+T_pixy2ErrorCode PIXY2::pixy2_sndGetFPS (void){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 0;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -177,7 +177,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndGetBlocks (Byte sigmap, Byte maxBloc){
+T_pixy2ErrorCode PIXY2::pixy2_sndGetBlocks (Byte sigmap, Byte maxBloc){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 2;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -193,7 +193,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndGetMainFeature (Byte type, Byte feature){
+T_pixy2ErrorCode PIXY2::pixy2_sndGetMainFeature (Byte type, Byte feature){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 2;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -209,7 +209,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetMode (Byte mode){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetMode (Byte mode){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 1;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -224,7 +224,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetNexTurn (Word angle){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetNexTurn (Word angle){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 2;
T_Word tmp;
@@ -243,7 +243,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetDefaultTurn (Word angle){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetDefaultTurn (Word angle){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 2;
T_Word tmp;
@@ -262,7 +262,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndSetVector (Byte vectorIndex){
+T_pixy2ErrorCode PIXY2::pixy2_sndSetVector (Byte vectorIndex){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 1;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -277,7 +277,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndReverseVector (void){
+T_pixy2ErrorCode PIXY2::pixy2_sndReverseVector (void){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 0;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -291,7 +291,7 @@
return PIXY2_OK;
}
-Pixy2ErrorCode PIXY2::pixy2_sndGetRGB (Word x, Word y, Byte saturate){
+T_pixy2ErrorCode PIXY2::pixy2_sndGetRGB (Word x, Word y, Byte saturate){
T_pixy2SendBuffer msg;
int i = 0, dataSize = 3;
msg.frame.header.pixSync = PIXY2_SYNC;
@@ -311,10 +311,10 @@
/* La fonction est bloquante à l'envoi (pas vraiment le choix), mais elle est non bloquante en réception. On essayera de faire une fonction non bloquante en envoi avec write, mais c'est pas la priorité.
Le principe c'est de stocker dans un buffer circulaire les données au fur et à mesure qu'elle sont reçues et de traiter uniquement en castant les infos. Pour cela, il faut recevoir et stocker. */
-Pixy2ErrorCode PIXY2::pixy2_getVersion (T_Pixy2Version *version){
+T_pixy2ErrorCode PIXY2::pixy2_getVersion (T_pixy2Version *version){
T_pixy2RcvHeader *msg = (T_pixy2RcvHeader*) &Pixy2_buffer[rPointer];
- Pixy2ErrorCode cr = PIXY2_OK;
+ T_pixy2ErrorCode cr = PIXY2_OK;
switch (etat) {
case idle : // Si la caméra est inactive
@@ -328,24 +328,24 @@
if (frameContainChecksum) { // Si la trame contient un checksum
if ( pixy2_validateChecksum (&Pixy2_buffer[rPointer]) ) { // On lance la validation du checksum
if (msg->pixType == PIXY2_REP_VERS) { // On vérifie que la trame est du type convenable
- version = (T_Pixy2Version*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
+ version = (T_pixy2Version*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
// On mappe le pointeur de version sur la donnée stockée dans la FIFO (ligne précédente)
etat = idle; // Et on annoce que la pixy est libre
} else {
if (msg->pixType == PIXY2_ERROR) { // Si on reçoit une trame d'erreur
- cr = *(Pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
+ cr = *(T_pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
// On mappe le résultat sur la donnée stockée dans la FIFO (ligne précédente)
}else cr = PIXY2_TYPE_ERROR; // Si le type ne correspond à rien de normal on signale une erreur
}
} else cr = PIXY2_BAD_CHECKSUM; // Si le checksum est faux on retourne une erreur aussi !
} else { // S'il n'y a pas de checksum (pas normal mais on ne sait jamais)
if (msg->pixType == PIXY2_REP_VERS) { // On vérifie que la trame est du type convenable
- version = (T_Pixy2Version*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
+ version = (T_pixy2Version*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
// Si le checksum et le type sont bon, on mappe le pointeur de résultat sur la FIFO (ligne précédente)
etat = idle; // Et on annoce que la pixy est libre
} else {
if (msg->pixType == PIXY2_ERROR) { // Si on reçoit une trame d'erreur
- cr = *(Pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
+ cr = *(T_pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
// On mappe le résultat sur la donnée stockée dans la FIFO (ligne précédente)
}else cr = PIXY2_TYPE_ERROR; // Si le type ne correspond à rien de normal on signale une erreur
}
@@ -359,10 +359,10 @@
return cr;
}
-Pixy2ErrorCode PIXY2::pixy2_getResolution (T_Pixy2Resolution *resolution){
+T_pixy2ErrorCode PIXY2::pixy2_getResolution (T_pixy2Resolution *resolution){
T_pixy2RcvHeader *msg = (T_pixy2RcvHeader*) &Pixy2_buffer[rPointer];
- Pixy2ErrorCode cr = PIXY2_OK;
+ T_pixy2ErrorCode cr = PIXY2_OK;
switch (etat) {
case idle : // Si la caméra est inactive
@@ -376,24 +376,24 @@
if (frameContainChecksum) { // Si la trame contient un checksum
if ( pixy2_validateChecksum (&Pixy2_buffer[rPointer]) ) { // On lance la validation du checksum
if (msg->pixType == PIXY2_REP_RESOL) { // On vérifie que la trame est du type convenable
- resolution = (T_Pixy2Resolution*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
+ resolution = (T_pixy2Resolution*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
// Si le checksum et le type sont bon, on mappe le pointeur de résultat sur la FIFO (ligne précédente)
etat = idle; // Et on annoce que la pixy est libre
} else {
if (msg->pixType == PIXY2_ERROR) { // Si on reçoit une trame d'erreur
- cr = *(Pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
+ cr = *(T_pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_CSHEADERSIZE];
// On mappe le résultat sur la donnée stockée dans la FIFO (ligne précédente)
}else cr = PIXY2_TYPE_ERROR; // Si le type ne correspond à rien de normal on signale une erreur
}
} else cr = PIXY2_BAD_CHECKSUM; // Si le checksum est faux on retourne une erreur aussi !
} else { // S'il n'y a pas de checksum (pas normal mais on ne sait jamais)
if (msg->pixType == PIXY2_REP_RESOL) { // On vérifie que la trame est du type convenable
- resolution = (T_Pixy2Resolution*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
+ resolution = (T_pixy2Resolution*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
// Si le checksum et le type sont bon, on mappe le pointeur de résultat sur la FIFO (ligne précédente)
etat = idle; // Et on annoce que la pixy est libre
} else {
if (msg->pixType == PIXY2_ERROR) { // Si on reçoit une trame d'erreur
- cr = *(Pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
+ cr = *(T_pixy2ErrorCode*) &Pixy2_buffer[rPointer + PIXY2_NCSHEADERSIZE];
// On mappe le résultat sur la donnée stockée dans la FIFO (ligne précédente)
}else cr = PIXY2_TYPE_ERROR; // Si le type ne correspond à rien de normal on signale une erreur
}
@@ -408,22 +408,22 @@
}
-Pixy2ErrorCode PIXY2::pixy2_setCameraBrightness (Byte brightness){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setServos (Word s0, Word s1){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setLED (Byte red, Byte green, Byte blue){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setLamp (Byte upper, Byte lower){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_getFPS (T_pixy2ReturnCode *framerate){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_getBlocks (Byte sigmap, Byte maxBloc){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_getMainFeature (Byte features){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_getAllFeature (Byte features){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setMode (Byte mode){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setNexTurn (Word angle){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setDefaultTurn (Word angle){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_setVector (Byte vectorIndex){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_ReverseVector (void){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setCameraBrightness (Byte brightness){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setServos (Word s0, Word s1){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setLED (Byte red, Byte green, Byte blue){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setLamp (Byte upper, Byte lower){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_getFPS (T_pixy2ReturnCode *framerate){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_getBlocks (Byte sigmap, Byte maxBloc){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_getMainFeature (Byte features){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_getAllFeature (Byte features){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setMode (Byte mode){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setNexTurn (Word angle){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setDefaultTurn (Word angle){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_setVector (Byte vectorIndex){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_ReverseVector (void){return 0;}
+T_pixy2ErrorCode PIXY2::pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel){return 0;}
-Pixy2ErrorCode PIXY2::pixy2_validateChecksum (Byte* tab){
+T_pixy2ErrorCode PIXY2::pixy2_validateChecksum (Byte* tab){
Word i, sum = 0;
T_Word *tmp;
--- a/pixy2.h Tue Mar 12 14:06:53 2019 +0000
+++ b/pixy2.h Tue Mar 12 14:16:53 2019 +0000
@@ -79,7 +79,7 @@
* \param PIXY2_TYPE_ERROR : Unexpected message type
* @note More documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:general_api#error-codes
*/
-typedef int Pixy2ErrorCode;
+typedef int T_pixy2ErrorCode;
#define PIXY2_OK 0
#define PIXY2_MISC_ERROR -1
@@ -213,7 +213,7 @@
Byte pixFWVersionMin;
Word pixFWBuild;
char pixHFString[10];
-}T_Pixy2Version;
+}T_pixy2Version;
/**
* \struct T_Pixy2Resolution
@@ -224,7 +224,7 @@
typedef struct {
Word pixFrameWidth;
Word pixFrameHeight;
-}T_Pixy2Resolution;
+}T_pixy2Resolution;
/**
* \struct T_pixy2Bloc
@@ -271,7 +271,7 @@
Byte pixY1;
Byte pixIndex;
Byte pixFlags;
-}T_Pixy2Vector;
+}T_pixy2Vector;
/**
* \struct T_Pixy2InterLine
@@ -287,7 +287,7 @@
Byte pixIndex;
Byte pixReserved;
sWord pixAngle;
-}T_Pixy2InterLine;
+}T_pixy2InterLine;
/**
* \struct T_pixy2Intersection
@@ -383,7 +383,7 @@
* @param version (T_Pixy2Version - passed by reference) : pointer to the version data structure
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_getVersion (T_Pixy2Version *version);
+T_pixy2ErrorCode pixy2_getVersion (T_pixy2Version *version);
/**
* Gets the width and height of the frames used by the current program.
@@ -393,7 +393,7 @@
* @param resolution (T_Pixy2Resolution - passed by reference) : pointer to the resolution data structure
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_getResolution (T_Pixy2Resolution *resolution);
+T_pixy2ErrorCode pixy2_getResolution (T_pixy2Resolution *resolution);
/**
* Sets the relative exposure level of Pixy2's image sensor.
@@ -403,7 +403,7 @@
* @param brightness (Byte - passed by value) : brightness level
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_setCameraBrightness (Byte brightness);
+T_pixy2ErrorCode pixy2_setCameraBrightness (Byte brightness);
/**
* Sets the servo positions of servos plugged into Pixy2's two RC servo connectors.
@@ -413,7 +413,7 @@
* @param s1 (Word - passed by value) : value between 0 and 511
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_setServos (Word s0, Word s1);
+T_pixy2ErrorCode pixy2_setServos (Word s0, Word s1);
/**
* Sets Pixy2's RGB LED value. The three arguments sets the brightness of the red, green and blue sections of the LED.
@@ -425,7 +425,7 @@
* @param blue (Byte - passed by value) : Blue component value (between 0 and 255)
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_setLED (Byte red, Byte green, Byte blue);
+T_pixy2ErrorCode pixy2_setLED (Byte red, Byte green, Byte blue);
/**
* Turns on/off Pixy2's integrated light source.
@@ -437,7 +437,7 @@
* @param lower (Byte - passed by value) : binary, zero or non-zero
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_setLamp (Byte upper, Byte lower);
+T_pixy2ErrorCode pixy2_setLamp (Byte upper, Byte lower);
/**
* Gets Pixy2's framerate.
@@ -448,7 +448,7 @@
* @param framerate (T_pixy2returnCode - passed by reference) : acknoledge
* @return Pixy2ErrorCode : error code.
*/
-Pixy2ErrorCode pixy2_getFPS (T_pixy2ReturnCode *framerate);
+T_pixy2ErrorCode pixy2_getFPS (T_pixy2ReturnCode *framerate);
/**
* Gets all detected blocks in the most recent frame.
@@ -463,7 +463,7 @@
* @note Filtering is based on ORing codes : 1 for sig1, 2 for sig2, 4 for sig3, 8 for sig4, 16 for sig5, 32 for sig6, 64 sor sig7 and 128 for color code.
* @note So sigmap = 255 means accept all and sigmap = 0 means reject all. For example filtering to get only sig1 and sig5 means using sigmap = 17 (16 + 1).
*/
-Pixy2ErrorCode pixy2_getBlocks (Byte sigmap, Byte maxBloc);
+T_pixy2ErrorCode pixy2_getBlocks (Byte sigmap, Byte maxBloc);
/**
* This function gets the latest main features of Line tracking (including the Vector, any intersection that connects to the Vector, and barcodes).
@@ -479,7 +479,7 @@
* @note Filtering is based on ORing codes : 1 for vectors, 2 for intersections, 4 for barcodes.
* @note So 7 = accept all, 0 = reject all. For example filtering to get only vectors and barcode means using feature = 5 (1 + 4).
*/
-Pixy2ErrorCode pixy2_getMainFeature (Byte features);
+T_pixy2ErrorCode pixy2_getMainFeature (Byte features);
/**
* This function gets all the latest features of Line tracking (including the Vector, any intersection that connects to the Vector, and barcodes).
@@ -494,22 +494,22 @@
* @note So for filtering : 7 = accept all, 0 = reject all. For example filtering to get only vectors and barcode means using feature = 5 (1 + 4).
* @note So for return value : 1 means only vector(s) detected, 2 means only intersection(s) detected, 3 vector(s) and intersection(s) detected and so on.
*/
-Pixy2ErrorCode pixy2_getAllFeature (Byte features);
-Pixy2ErrorCode pixy2_setMode (Byte mode);
-Pixy2ErrorCode pixy2_setNexTurn (Word angle);
-Pixy2ErrorCode pixy2_setDefaultTurn (Word angle);
-Pixy2ErrorCode pixy2_setVector (Byte vectorIndex);
-Pixy2ErrorCode pixy2_ReverseVector (void);
-Pixy2ErrorCode pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel);
+T_pixy2ErrorCode pixy2_getAllFeature (Byte features);
+T_pixy2ErrorCode pixy2_setMode (Byte mode);
+T_pixy2ErrorCode pixy2_setNexTurn (Word angle);
+T_pixy2ErrorCode pixy2_setDefaultTurn (Word angle);
+T_pixy2ErrorCode pixy2_setVector (Byte vectorIndex);
+T_pixy2ErrorCode pixy2_ReverseVector (void);
+T_pixy2ErrorCode pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel);
// Variables globales Publiques
Byte Pixy2_numBlocks;
T_pixy2Bloc Pixy2_blocks[];
Byte Pixy2_numVectors;
-T_Pixy2Vector Pixy2_vectors[];
+T_pixy2Vector Pixy2_vectors[];
Byte Pixy2_numIntersections;
T_pixy2Intersection Pixy2_intersections[];
-T_Pixy2InterLine Pixy2_intLines[];
+T_pixy2InterLine Pixy2_intLines[];
Byte Pixy2_numBarcodes;
T_pixy2BarCode Pixy2_barcodes[];
@@ -521,24 +521,24 @@
Byte frameContainChecksum;
// Fonctions privées
-Pixy2ErrorCode pixy2_sndGetVersion (void);
-Pixy2ErrorCode pixy2_sndGetResolution (void);
-Pixy2ErrorCode pixy2_sndSetCameraBrightness (Byte brightness);
-Pixy2ErrorCode pixy2_sndSetServo (Word s0, Word s1);
-Pixy2ErrorCode pixy2_sndSetLED (Byte red, Byte green, Byte blue);
-Pixy2ErrorCode pixy2_sndSetLamp (Byte upper, Byte lower);
-Pixy2ErrorCode pixy2_sndGetFPS (void);
-Pixy2ErrorCode pixy2_sndGetBlocks (Byte sigmap, Byte maxBloc);
-Pixy2ErrorCode pixy2_sndGetMainFeature (Byte type, Byte feature);
-Pixy2ErrorCode pixy2_sndSetMode (Byte mode);
-Pixy2ErrorCode pixy2_sndSetNexTurn (Word angle);
-Pixy2ErrorCode pixy2_sndSetDefaultTurn (Word angle);
-Pixy2ErrorCode pixy2_sndSetVector (Byte vectorIndex);
-Pixy2ErrorCode pixy2_sndReverseVector (void);
-Pixy2ErrorCode pixy2_sndGetRGB (Word x, Word y, Byte saturate);
+T_pixy2ErrorCode pixy2_sndGetVersion (void);
+T_pixy2ErrorCode pixy2_sndGetResolution (void);
+T_pixy2ErrorCode pixy2_sndSetCameraBrightness (Byte brightness);
+T_pixy2ErrorCode pixy2_sndSetServo (Word s0, Word s1);
+T_pixy2ErrorCode pixy2_sndSetLED (Byte red, Byte green, Byte blue);
+T_pixy2ErrorCode pixy2_sndSetLamp (Byte upper, Byte lower);
+T_pixy2ErrorCode pixy2_sndGetFPS (void);
+T_pixy2ErrorCode pixy2_sndGetBlocks (Byte sigmap, Byte maxBloc);
+T_pixy2ErrorCode pixy2_sndGetMainFeature (Byte type, Byte feature);
+T_pixy2ErrorCode pixy2_sndSetMode (Byte mode);
+T_pixy2ErrorCode pixy2_sndSetNexTurn (Word angle);
+T_pixy2ErrorCode pixy2_sndSetDefaultTurn (Word angle);
+T_pixy2ErrorCode pixy2_sndSetVector (Byte vectorIndex);
+T_pixy2ErrorCode pixy2_sndReverseVector (void);
+T_pixy2ErrorCode pixy2_sndGetRGB (Word x, Word y, Byte saturate);
void pixy2_getByte ();
-Pixy2ErrorCode pixy2_validateChecksum (Byte* tab);
+T_pixy2ErrorCode pixy2_validateChecksum (Byte* tab);
};
#endif
\ No newline at end of file