librairie de fonctions de base du pixy : recuperation infos sur bloc detecte

Dependencies:   mbed pixy_lib_base

Revision:
0:0dde75f5e5a2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 20 15:38:37 2020 +0000
@@ -0,0 +1,25 @@
+
+/* 17/11/20 : Ce pg affiche les coordonnées x et y du block détecté par la pixy */
+#include "Pixy.h"
+
+Serial serial(USBTX, USBRX);
+SPI spi(PC_12, PC_11, PC_10); // mosi, miso, clk du SPI3
+PixySPI pixy(&spi);
+
+int main()
+{
+    uint16_t blocks;
+    serial.printf("debut....\n\r");
+    spi.frequency(1000000);
+    while(1) 
+    {
+        serial.printf("nouvel essai : ");
+        blocks = pixy.getBlocks();
+        if (blocks) 
+        {
+               serial.printf("Detected %d : ", blocks);
+               serial.printf("x=%d, y=%d \n\r",pixy.blocks[0].x,pixy.blocks[0].y);
+        }
+        wait(1);            
+    }
+}
\ No newline at end of file