
#define A1A 6
#define A1B 7
#define B1A 8
#define B1B 9
int vitesse = 150; // 0 à 255
void setup() {
// Init Motor A
pinMode(A1A, OUTPUT);
pinMode(A1B, OUTPUT);
// Init Motor B
/*
pinMode(B1A, OUTPUT);
pinMode(B1B, OUTPUT);
*/
}
void loop() {
// Motor A
// Avant
analogWrite(A1A, vitesse);
analogWrite(A1B, 0);
delay(2000);
// Stop
analogWrite(A1A, 0);
analogWrite(A1B, 0);
delay(500);
// Arrière
analogWrite(A1A, 0);
analogWrite(A1B, vitesse);
delay(2000);
// Stop
analogWrite(A1A, 0);
analogWrite(A1B, 0);
delay(500);
// Motor B
/*
// Avant
analogWrite(B1A, vitesse);
analogWrite(B1B, 0);
delay(2000);
// Stop
analogWrite(B1A, 0);
analogWrite(B1B, 0);
delay(500);
// Arrière
analogWrite(B1A, 0);
analogWrite(B1B, vitesse);
delay(2000);
// Stop
analogWrite(B1A, 0);
analogWrite(B1B, 0);
delay(500);
// Pause avant de boucler
delay(1000);
*/
}
l9110.pdf