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
Diff: Classes/Voiture.h
- Revision:
- 0:8743b606abc3
- Child:
- 1:a9af73d5abd4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Classes/Voiture.h Tue Feb 11 15:41:45 2020 +0000 @@ -0,0 +1,34 @@ +#ifndef VOITURE_H +#define VOITURE_H + +#include "NXPCam.h" + +#define ROUES_DROITES 0.075f +#define MAX_DROITE 0.1f +#define MAX_GAUCHE 0.05f +#define PAS 0.001f + +class Voiture +{ +public: + Voiture(); + void gestionDeplacement(); + void tourne(int val); // val comprise entre -100 (gauche) et 100 (droite) + +private: + NXPCam cam; // Pixy qui gère le traitement d'images + + PwmOut orientation; // Correspond au servo-moteur qui oriente les roues avant + float futureOrientation; // variable expliquée en-dessous + void gestionRoues(); // fct qui tourne en continu et qui permet de faire tourner progressivement les roues vers 'futureOrientation' + Timer timerRotation; // timer qui permet de faire tourner progressivement + + PwmOut motG; + PwmOut motD; + DigitalIn OnOff; + + // Debug + BusOut leds; +}; + +#endif // VOITURE_H \ No newline at end of file