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.
pins.cpp@19:c419033c0967, 2020-10-12 (annotated)
- Committer:
- Nanaud
- Date:
- Mon Oct 12 19:17:40 2020 +0000
- Revision:
- 19:c419033c0967
- Parent:
- 16:ae65ce77b1f9
- Child:
- 20:7d206773f39e
Dernieres modifs
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 | 6:ea6b30c4bb01 | 4 | InterruptIn btn(PC_13); |
Nanaud | 19:c419033c0967 | 5 | //InterruptIn cordon(PC_8); |
Nanaud | 6:ea6b30c4bb01 | 6 | |
Nanaud | 0:dc036b67c87c | 7 | // Capteurs à ultrasons |
Nanaud | 0:dc036b67c87c | 8 | DigitalOut trigger(PB_9); |
Nanaud | 0:dc036b67c87c | 9 | InterruptIn echo1(PA_11); |
Nanaud | 0:dc036b67c87c | 10 | InterruptIn echo2(PB_12); |
Nanaud | 0:dc036b67c87c | 11 | InterruptIn echo3(PB_2); |
Nanaud | 0:dc036b67c87c | 12 | InterruptIn echo4(PB_1); |
Nanaud | 0:dc036b67c87c | 13 | InterruptIn echo5(PB_15); |
Nanaud | 0:dc036b67c87c | 14 | InterruptIn echo6(PB_14); |
Nanaud | 0:dc036b67c87c | 15 | |
Nanaud | 0:dc036b67c87c | 16 | // Drivers DRV8825 |
Nanaud | 0:dc036b67c87c | 17 | #define STEP1 PA_6 |
Nanaud | 0:dc036b67c87c | 18 | #define STEP2 PB_6 |
Nanaud | 0:dc036b67c87c | 19 | #define DIR1 PC_2 |
Nanaud | 10:0714feaaaee1 | 20 | #define DIR2 PC_3 |
Nanaud | 10:0714feaaaee1 | 21 | #define EN1 PA_15 |
Nanaud | 10:0714feaaaee1 | 22 | #define EN2 PA_14 |
Nanaud | 16:ae65ce77b1f9 | 23 | #define diametreRoue 51.45 |
Nanaud | 5:34ed652f8c31 | 24 | #define rayonRoue (diametreRoue/2) |
Nanaud | 5:34ed652f8c31 | 25 | #define nbPas 6400 //1000 |
Nanaud | 10:0714feaaaee1 | 26 | //BusOut mode(PB_7, PC_13, PC_14); // LSB ... MSB |
Nanaud | 10:0714feaaaee1 | 27 | DigitalOut mode_M0(PB_7); |
Nanaud | 10:0714feaaaee1 | 28 | //DigitalOut mode_M1(PC_13); // Inutile |
Nanaud | 10:0714feaaaee1 | 29 | //DigitalOut mode_M2(PC_14); // Hardware |
Nanaud | 10:0714feaaaee1 | 30 | DRV8825 drvGauche(EN1,DIR1,STEP1,rayonRoue,nbPas); |
Nanaud | 10:0714feaaaee1 | 31 | DRV8825 drvDroite(EN2,DIR2,STEP2,rayonRoue,nbPas); |
Nanaud | 0:dc036b67c87c | 32 | |
Nanaud | 1:2fe8c402ee79 | 33 | // Codeurs (Réf : LPJ3806-1000BM-G5-24E) |
Nanaud | 1:2fe8c402ee79 | 34 | InterruptIn cdgA(PA_8); // Codeur de gauche |
Nanaud | 5:34ed652f8c31 | 35 | DigitalIn cdgB(PA_9); |
Nanaud | 1:2fe8c402ee79 | 36 | InterruptIn cddA(PA_0); // Codeur de droite |
Nanaud | 5:34ed652f8c31 | 37 | DigitalIn cddB(PA_1); |