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
Classes/Voiture.h@0:8743b606abc3, 2020-02-11 (annotated)
- Committer:
- Wael_H
- Date:
- Tue Feb 11 15:41:45 2020 +0000
- Revision:
- 0:8743b606abc3
- Child:
- 1:a9af73d5abd4
Version direction a peu pres
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wael_H | 0:8743b606abc3 | 1 | #ifndef VOITURE_H |
Wael_H | 0:8743b606abc3 | 2 | #define VOITURE_H |
Wael_H | 0:8743b606abc3 | 3 | |
Wael_H | 0:8743b606abc3 | 4 | #include "NXPCam.h" |
Wael_H | 0:8743b606abc3 | 5 | |
Wael_H | 0:8743b606abc3 | 6 | #define ROUES_DROITES 0.075f |
Wael_H | 0:8743b606abc3 | 7 | #define MAX_DROITE 0.1f |
Wael_H | 0:8743b606abc3 | 8 | #define MAX_GAUCHE 0.05f |
Wael_H | 0:8743b606abc3 | 9 | #define PAS 0.001f |
Wael_H | 0:8743b606abc3 | 10 | |
Wael_H | 0:8743b606abc3 | 11 | class Voiture |
Wael_H | 0:8743b606abc3 | 12 | { |
Wael_H | 0:8743b606abc3 | 13 | public: |
Wael_H | 0:8743b606abc3 | 14 | Voiture(); |
Wael_H | 0:8743b606abc3 | 15 | void gestionDeplacement(); |
Wael_H | 0:8743b606abc3 | 16 | void tourne(int val); // val comprise entre -100 (gauche) et 100 (droite) |
Wael_H | 0:8743b606abc3 | 17 | |
Wael_H | 0:8743b606abc3 | 18 | private: |
Wael_H | 0:8743b606abc3 | 19 | NXPCam cam; // Pixy qui gère le traitement d'images |
Wael_H | 0:8743b606abc3 | 20 | |
Wael_H | 0:8743b606abc3 | 21 | PwmOut orientation; // Correspond au servo-moteur qui oriente les roues avant |
Wael_H | 0:8743b606abc3 | 22 | float futureOrientation; // variable expliquée en-dessous |
Wael_H | 0:8743b606abc3 | 23 | void gestionRoues(); // fct qui tourne en continu et qui permet de faire tourner progressivement les roues vers 'futureOrientation' |
Wael_H | 0:8743b606abc3 | 24 | Timer timerRotation; // timer qui permet de faire tourner progressivement |
Wael_H | 0:8743b606abc3 | 25 | |
Wael_H | 0:8743b606abc3 | 26 | PwmOut motG; |
Wael_H | 0:8743b606abc3 | 27 | PwmOut motD; |
Wael_H | 0:8743b606abc3 | 28 | DigitalIn OnOff; |
Wael_H | 0:8743b606abc3 | 29 | |
Wael_H | 0:8743b606abc3 | 30 | // Debug |
Wael_H | 0:8743b606abc3 | 31 | BusOut leds; |
Wael_H | 0:8743b606abc3 | 32 | }; |
Wael_H | 0:8743b606abc3 | 33 | |
Wael_H | 0:8743b606abc3 | 34 | #endif // VOITURE_H |