code for testing the pixy

Dependencies:   mbed

Revision:
0:214d306295fa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Pixy.h	Tue May 30 09:56:04 2017 +0000
@@ -0,0 +1,32 @@
+#include <mbed.h>
+ 
+class Pixy
+{
+public:
+    Pixy(Serial& cam);
+     
+    struct pixy_s {
+        uint16_t checksum;
+        uint16_t signature;
+        uint16_t x;
+        uint16_t y;
+        uint16_t width;
+        uint16_t height;
+    };
+ 
+    int getX();
+    int getY();
+    int getSignature();
+    int getHeight();
+    int getWidth();
+    bool objectDetected();
+ 
+private:
+    void rxCallback();
+     
+    bool startFound;
+    int detects;
+     
+    Serial& cam;
+    pixy_s pixy;
+};
\ No newline at end of file