Theo Le Paih / Mbed 2 deprecated Lib_Pixy2

Dependencies:   mbed

Revision:
1:dd81f4065b6b
Parent:
0:dde1b9d6c9d6
Child:
3:6ba43af28440
--- a/pixy2.cpp	Thu Feb 28 08:34:15 2019 +0000
+++ b/pixy2.cpp	Thu Feb 28 11:13:47 2019 +0000
@@ -340,7 +340,7 @@
 int PIXY2::pixy2_setServos (Word s0, Word s1){return 0;} 
 int PIXY2::pixy2_setLED (Byte red, Byte green, Byte blue){return 0;}
 int PIXY2::pixy2_setLamp (Byte upper, Byte lower){return 0;}
-int PIXY2::pixy2_getFPS (T_pixy2Framerate framerate){return 0;}
+int PIXY2::pixy2_getFPS (T_pixy2returnCode *framerate){return 0;}
 int PIXY2::pixy2_getBlocks (Byte sigmap, Byte maxBloc){return 0;}
 int PIXY2::pixy2_getMainFeature (Byte type, Byte features){return 0;}
 int PIXY2::pixy2_getAllFeature (Byte features){return 0;}
@@ -352,8 +352,11 @@
 int PIXY2::pixy2_getRGB (Word x, Word y, Byte saturate, T_pixy2Pixel *pixel){return 0;}
 
 int PIXY2::pixy2_validateChecksum (Byte* tab){
-    Word sum;
-    
+    Word    i, sum = 0;
+    T_Word  *tmp;
     
-    return 1;}
-
+    for (i=0; i<*(tab+3);i++)   sum = sum + *(tab + PIXY2_CSHEADERSIZE + i);
+    tmp = (T_Word*) (tab+4);
+    if (tmp->mot == sum) return 0;
+    else return -1;
+}