toujours pour mes débiles

Dependencies:   mbed pixy

Files at this revision

API Documentation at this revision

Comitter:
pirottealex
Date:
Tue Mar 27 12:05:35 2018 +0000
Commit message:
pour les teb? de 1?re ann?e;

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 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	Tue Mar 27 12:05:35 2018 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "Pixy.h"
+#include "PixyLink.h"
+#define PERIOD 0.0001
+#define seuil_taille 3000 //seuil auquel le robot arrete d'avancer 
+#define K 0.2// coef erreur pour asservissement
+Serial pc(USBTX,USBRX);
+
+
+//variables globales
+
+float taille =0;
+
+//Programme principal
+uint16_t blocks;
+Pixy pixy = Pixy(p28,p27);
+int main()
+{
+    
+    int j=0;  
+    
+    pixy.setSerialOutput(&pc);
+    int errorX = 0, errorY = 0,block;
+    pc.printf("alive");
+    while(1) {
+
+        blocks = pixy.getBlocks();
+
+        if(blocks) 
+        {
+            
+            taille=pixy.blocks[j].width*pixy.blocks[j].height;
+            errorX = (160-pixy.blocks[j].x);
+            errorY = (100-pixy.blocks[j].y);
+            pc.printf("non sig: %d x: %d y: %d width: %d height: %d\n\r", pixy.blocks[j].signature, pixy.blocks[j].x, pixy.blocks[j].y, pixy.blocks[j].width, pixy.blocks[j].height);
+        }
+
+        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 27 12:05:35 2018 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/794e51388b66
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pixy.lib	Tue Mar 27 12:05:35 2018 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/pirottealex/code/pixy/#e7cb59aaf759