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.
Diff: main.cpp
- Revision:
- 26:a56cc5d715e9
- Parent:
- 25:2a2fcb9e4775
- Child:
- 27:bee63ac9b70b
diff -r 2a2fcb9e4775 -r a56cc5d715e9 main.cpp --- a/main.cpp Thu Nov 21 09:31:05 2019 +0000 +++ b/main.cpp Thu Nov 28 07:39:32 2019 +0000 @@ -19,7 +19,6 @@ { PIXY2 maPixy(PC_12, PD_2); // PC_12 : UART5_TX --- PD_2 : UART5_RX - T_pixy2Resolution* testResolution; T_pixy2ErrorCode rep; // Initialisations @@ -44,15 +43,15 @@ break; case SND : - rep = maPixy.pixy2_getResolution(&testResolution); - //pc.printf("%d\n\r",rep); // Affichage des erreurs renvoyées + rep = maPixy.pixy2_getMainFeature(1); + if (rep == PIXY2_BAD_CHECKSUM) { etat = CHECKSUM_ERROR; } if (temps.read()>0.5f) { etat = TIMEOUT; } - if (rep == PIXY2_OK) { + if (rep >= PIXY2_VECTOR) { etat = OK; } break; @@ -70,8 +69,12 @@ break; case OK : - pc.printf("Pixy frame width : %d\n\r", testResolution->pixFrameWidth); - pc.printf("Pixy frame height : %d\n\r", testResolution->pixFrameHeight); + pc.printf("Number of vectors : %d\n\r", maPixy.Pixy2_numVectors); + for(int i=0; i<maPixy.Pixy2_numVectors; ++i) { + pc.printf("Vector number : %d\n\r", maPixy.Pixy2_vectors[i].pixIndex); + pc.printf("x0 : %d - y0 : %d\n\r", maPixy.Pixy2_vectors[i].pixX0, maPixy.Pixy2_vectors[i].pixY0); + pc.printf("x1 : %d - y1 : %d\n\r", maPixy.Pixy2_vectors[i].pixX1, maPixy.Pixy2_vectors[i].pixY1); + } etat = IDLE; break;