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

Dependencies:   mbed pixy_lib_base

Files at this revision

API Documentation at this revision

Comitter:
michelmoulin
Date:
Fri Nov 20 15:38:37 2020 +0000
Commit message:
Affiche les coordonnees x et y du bloc le plus gros vu par la camera pixy

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
pixy_lib_base.lib Show annotated file Show diff for this revision Revisions of this file
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 20 15:38:37 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pixy_lib_base.lib	Fri Nov 20 15:38:37 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/michelmoulin/code/pixy_lib_base/#a1e10abfbd19