Moteur CC (DRV8876)
Matériel : DRV8876 Single Brushed DC Motor Driver Carrier
Caractéristiques :
- Tension : de 4.5V à 37V
- Courant maximal (en continu) : 1.3A
- Mesure du courant : 2.5V/A
Voir le moteur à courant continu
Mode PH/EN
Câblage

Broche PMODE à l’état bas :
- la broche PH détermine le sens de rotation du moteur
- la broche EN contrôle la tension d’alimentation du moteur (PWM)
Ce mode est généralement plus simple à utiliser car il ne nécessite qu’un seul signal PWM.
| EN | PH | OUT1 | OUT2 | operating mode |
|---|---|---|---|---|
| 0 | X | L | L | brake low (outputs shorted to ground) |
| PWM | 1 | PWM (H/L) | L | forward/brake at speed PWM % |
| PWM | 0 | L | PWM (H/L) | reverse/brake at speed PWM % |
Programmation
Avec la bibliothèque : DRV887x
Exemple :
#include "DRV887x.h"
DRV887x motor(9, 8); // EN = pin PWM 9, PH = pin 8
void setup() {
motor.begin();
}
void loop() {
motor.run(180); // Marche avant, environ 71 % du PWM
delay(2000);
motor.run(-100); // Marche arrière
delay(2000);
motor.run(0); // Freinage
delay(1000);
motor.brake(); // Freinage explicite
delay(1000);
}
