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
- Committer:
- Nanaud
- Date:
- 2020-07-26
- Revision:
- 6:ea6b30c4bb01
- Parent:
- 5:34ed652f8c31
- Child:
- 10:0714feaaaee1
File content as of revision 6:ea6b30c4bb01:
// Nom du fichier : pins.cpp
#include "pins.h"
InterruptIn btn(PC_13);
// Capteurs à ultrasons
DigitalOut trigger(PB_9);
InterruptIn echo1(PA_11);
InterruptIn echo2(PB_12);
InterruptIn echo3(PB_2);
InterruptIn echo4(PB_1);
InterruptIn echo5(PB_15);
InterruptIn echo6(PB_14);
// Drivers DRV8825
#define STEP1 PA_6
#define STEP2 PB_6
#define DIR1 PC_2
#define DIR2 PH_1
#define EN PC_3
#define diametreRoue 72 //51.45
#define rayonRoue (diametreRoue/2)
#define nbPas 6400 //1000
BusOut mode(PB_0, PC_1, PC_0); // LSB ... MSB
DRV8825 drvGauche(EN,DIR1,STEP1,rayonRoue,nbPas);
DRV8825 drvDroite(EN,DIR2,STEP2,rayonRoue,nbPas);
// Codeurs (Réf : LPJ3806-1000BM-G5-24E)
InterruptIn cdgA(PA_8); // Codeur de gauche
DigitalIn cdgB(PA_9);
InterruptIn cddA(PA_0); // Codeur de droite
DigitalIn cddB(PA_1);