Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed TPixy-Interface
Revision 1:b05954fae6d8, committed 2020-11-17
- Comitter:
- michelmoulin
- Date:
- Tue Nov 17 17:06:06 2020 +0000
- Parent:
- 0:886deae63aa3
- Commit message:
- Ce pg affiche les coordonnees x et y du block detecte par la pixy
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 14 00:38:32 2016 +0000
+++ b/main.cpp Tue Nov 17 17:06:06 2020 +0000
@@ -1,12 +1,25 @@
+
+/* 17/11/20 : Ce pg affiche les coordonnées x et y du block détecté par la pixy */
#include "Pixy.h"
-//#include "TPixyInterface.h"
-//#include "TPixy.h"
Serial serial(USBTX, USBRX);
-SPI spi(p5, p6, p7);
+SPI spi(PC_12, PC_11, PC_10); // mosi, miso, clk du SPI3
PixySPI pixy(&spi, &serial);
int main()
{
- runPanTiltDemo(&pixy, &serial);
+ 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