AresENSEA-CDF2020
/
AresCDFMainCode_capteur_US
Capteur_US
pins.cpp@4:ad9b7355332e, 2020-07-18 (annotated)
- Committer:
- Nanaud
- Date:
- Sat Jul 18 17:09:08 2020 +0000
- Revision:
- 4:ad9b7355332e
- Parent:
- 1:2fe8c402ee79
- Child:
- 5:34ed652f8c31
Ajout du debug en Bluetooth (Module HC-05)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nanaud | 1:2fe8c402ee79 | 1 | // Nom du fichier : pins.cpp |
Nanaud | 0:dc036b67c87c | 2 | #include "pins.h" |
Nanaud | 0:dc036b67c87c | 3 | |
Nanaud | 0:dc036b67c87c | 4 | // Capteurs à ultrasons |
Nanaud | 0:dc036b67c87c | 5 | DigitalOut trigger(PB_9); |
Nanaud | 0:dc036b67c87c | 6 | InterruptIn echo1(PA_11); |
Nanaud | 0:dc036b67c87c | 7 | InterruptIn echo2(PB_12); |
Nanaud | 0:dc036b67c87c | 8 | InterruptIn echo3(PB_2); |
Nanaud | 0:dc036b67c87c | 9 | InterruptIn echo4(PB_1); |
Nanaud | 0:dc036b67c87c | 10 | InterruptIn echo5(PB_15); |
Nanaud | 0:dc036b67c87c | 11 | InterruptIn echo6(PB_14); |
Nanaud | 0:dc036b67c87c | 12 | |
Nanaud | 0:dc036b67c87c | 13 | // Drivers DRV8825 |
Nanaud | 0:dc036b67c87c | 14 | #define STEP1 PA_6 |
Nanaud | 0:dc036b67c87c | 15 | #define STEP2 PB_6 |
Nanaud | 0:dc036b67c87c | 16 | #define DIR1 PC_2 |
Nanaud | 0:dc036b67c87c | 17 | #define DIR2 PH_1 |
Nanaud | 0:dc036b67c87c | 18 | #define EN PC_3 |
Nanaud | 4:ad9b7355332e | 19 | #define rRoue 70 // peut être 71 mm |
Nanaud | 4:ad9b7355332e | 20 | #define nbPas 1000 |
Nanaud | 4:ad9b7355332e | 21 | BusOut mode(PB_0, PC_1, PC_0); // LSB ... MSB |
Nanaud | 4:ad9b7355332e | 22 | DRV8825 drvGauche(EN,DIR1,STEP1,rRoue,nbPas); |
Nanaud | 4:ad9b7355332e | 23 | DRV8825 drvDroite(EN,DIR2,STEP2,rRoue,nbPas); |
Nanaud | 0:dc036b67c87c | 24 | |
Nanaud | 1:2fe8c402ee79 | 25 | // Codeurs (Réf : LPJ3806-1000BM-G5-24E) |
Nanaud | 1:2fe8c402ee79 | 26 | InterruptIn cdgA(PA_8); // Codeur de gauche |
Nanaud | 0:dc036b67c87c | 27 | InterruptIn cdgB(PA_9); |
Nanaud | 1:2fe8c402ee79 | 28 | InterruptIn cddA(PA_0); // Codeur de droite |
Nanaud | 0:dc036b67c87c | 29 | InterruptIn cddB(PA_1); |