AresENSEA-CDF2020
/
AresCDFMainCode_capteur_US
Capteur_US
Diff: pins.cpp
- Revision:
- 1:2fe8c402ee79
- Parent:
- 0:dc036b67c87c
- Child:
- 4:ad9b7355332e
diff -r dc036b67c87c -r 2fe8c402ee79 pins.cpp --- a/pins.cpp Wed Jul 08 19:51:28 2020 +0000 +++ b/pins.cpp Wed Jul 08 20:42:19 2020 +0000 @@ -1,17 +1,7 @@ +// Nom du fichier : pins.cpp #include "pins.h" -// Debug -Serial pc(USBTX, USBRX); -Ticker ticker_affUS; -Ticker ticker_affcd; -bool aff_US[6]; -bool aff_cd[4]; - - // Capteurs à ultrasons -float us_out[6]; -Timer tps; -Ticker ticker_US; DigitalOut trigger(PB_9); InterruptIn echo1(PA_11); InterruptIn echo2(PB_12); @@ -20,25 +10,18 @@ InterruptIn echo5(PB_15); InterruptIn echo6(PB_14); - // Drivers DRV8825 - //LSB //MSB -BusOut MODE(PB_0, PC_1, PC_0); #define STEP1 PA_6 #define STEP2 PB_6 #define DIR1 PC_2 #define DIR2 PH_1 #define EN PC_3 +BusOut MODE(PB_0, PC_1, PC_0); // LSB ... MSB DRV8825 drvGauche(EN,DIR1,STEP1); DRV8825 drvDroite(EN,DIR2,STEP2); - -// Codeurs LPJ3806-1000BM-G5-24E -long cpt_cdgA=0; -long cpt_cdgB=0; -InterruptIn cdgA(PA_8); +// Codeurs (Réf : LPJ3806-1000BM-G5-24E) +InterruptIn cdgA(PA_8); // Codeur de gauche InterruptIn cdgB(PA_9); -long cpt_cddA=0; -long cpt_cddB=0; -InterruptIn cddA(PA_0); +InterruptIn cddA(PA_0); // Codeur de droite InterruptIn cddB(PA_1);