![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ikiiopop^^p^p
Diff: main.cpp
- Revision:
- 0:0ddbc97e7270
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Mar 23 15:50:03 2018 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" + +#include "Pixy.h" +#include "PixyLink.h" + + +Serial pc (USBTX,USBRX); +int main() +{ + uint16_t blocks; + float taille; + int j=0; + int i=0; + Pixy pixy= Pixy(p28,p27); + pixy.setSerialOutput(&pc); + pc.printf("alive"); + + while(1) { + + blocks = pixy.getBlocks(); + //pc.printf("etat=%d\n\r",etat); + //pc.printf("etat=%d,capt1= %d, capt2= %d, us_ar=%f, bp=%d, boussole=%f\n\r",etat,captL1,captL3,us_arriere,bp.read(),gBoussole); + if (blocks) { + + taille=pixy.blocks[j].width*pixy.blocks[j].height; + + pc.printf("count=%d, block=%d, taille=%f,sig: %d x: %d y: %d width: %d height: %d\n\r",blocks,taille, pixy.blocks[j].signature, pixy.blocks[j].x, pixy.blocks[j].y, pixy.blocks[j].width, pixy.blocks[j].height); + //pc.printf("OK"); + } + + + + } +} + + +