NXPCup_Cachan / Mbed 2 deprecated NXPCup

Dependencies:   mbed

Committer:
Wael_H
Date:
Wed Feb 26 16:47:05 2020 +0000
Revision:
1:a9af73d5abd4
Parent:
0:8743b606abc3
Child:
2:1103f5d61035
tourne a peu pres bien et avance doucement (fonctionnel en ligne droite uniquement)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wael_H 0:8743b606abc3 1 #ifndef NXPCAM_H
Wael_H 0:8743b606abc3 2 #define NXPCAM_H
Wael_H 0:8743b606abc3 3
Wael_H 0:8743b606abc3 4 #include "PIXY2.h"
Wael_H 0:8743b606abc3 5 #include "Vector.h"
Wael_H 0:8743b606abc3 6
Wael_H 0:8743b606abc3 7 #define SCREEN_CENTER 39.5f // resolution : 79 - 52
Wael_H 0:8743b606abc3 8 #define INFO_NON_EXPLOITABLE 404
Wael_H 0:8743b606abc3 9
Wael_H 0:8743b606abc3 10 class NXPCam
Wael_H 0:8743b606abc3 11 {
Wael_H 0:8743b606abc3 12 public:
Wael_H 0:8743b606abc3 13 NXPCam();
Wael_H 0:8743b606abc3 14
Wael_H 0:8743b606abc3 15 /* Fonction qui renvoie une valeur entre -100 et 100 (à peu près)
Wael_H 0:8743b606abc3 16 * correspondant à l'écart de trajectoire entre la piste et
Wael_H 0:8743b606abc3 17 * le milieu de l'écran de la Pixy.
Wael_H 0:8743b606abc3 18 * La valeur est positive lorsque la voiture est trop à droite
Wael_H 0:8743b606abc3 19 * et négative lorsqu'elle est trop à gauche */
Wael_H 0:8743b606abc3 20 int getDeviationTrajectoire();
Wael_H 0:8743b606abc3 21 int getNormeVecteurs();
Wael_H 1:a9af73d5abd4 22
Wael_H 1:a9af73d5abd4 23 // Fonctions outils
Wael_H 1:a9af73d5abd4 24 int getXinutile(int x0, int x1, int x2);
Wael_H 1:a9af73d5abd4 25 int getXinutile(int x0, int x1, int x2, int x0past, int x1past);
Wael_H 0:8743b606abc3 26
Wael_H 0:8743b606abc3 27 private:
Wael_H 0:8743b606abc3 28 PIXY2 pixy;
Wael_H 1:a9af73d5abd4 29 Vector v1, v2, v3;
Wael_H 0:8743b606abc3 30 };
Wael_H 0:8743b606abc3 31
Wael_H 0:8743b606abc3 32 #endif // NXPCAM_H