an SPI interface the cmu pixy camera

Dependents:   robotic_fish_ver_4_9_pixy UMO

Revision:
7:e57b18779bf1
Parent:
6:4bf8d39fc5ce
Child:
8:a915c5eff55a
--- a/pixy.cpp	Thu Jun 05 17:31:43 2014 +0000
+++ b/pixy.cpp	Fri Jun 06 16:18:49 2014 +0000
@@ -37,7 +37,7 @@
     }
 }
 
-void pixySPI::capture()
+void pixySPI::capture(Mutex* mutex)
 {
     memset(blocks, 0, numBlocks*sizeof(Block)); //destroy the old targets
     for (int i=0; i<numBlocks; ++i) {
@@ -71,8 +71,10 @@
         //printf("found block\n");
         if (blocks[0].signature!=INVALID_BLOCK)
         {
+            mutex->lock();
             bestX=blocks[0].x;
             bestY=blocks[0].y;
+            mutex->unlock();
         }
     }
     return;