#include <DRV8833.h>
DRV8833 driver = DRV8833();
int motorA1 = 5 ;
int motorA2 = 6;
int motorB1 = 11;
int motorB2 = 3;
int velocidadMotorA = 100;
int velocidadMotorB = 100;
void setup() {
driver.attachMotorA(motorA1, motorA2);
driver.attachMotorB(motorB1, motorB2);
}
void loop() {
robotAdelante();
digitalWrite(LED,HIGH);
delay(1000);
robotFrena();
delay(1000);
robotDerecha();
delay(650);
}
void robotAdelante(){
driver.motorAForward(velocidadMotorA);
driver.motorBForward(velocidadMotorB);
}
void robotFrena() {
driver.motorAStop();
driver.motorBStop();
}
void robotDerecha(){
driver.motorAForward(velocidadMotorA);
driver.motorBStop();
}
No comments:
Post a Comment
Gracias por sus comentarios
Note: Only a member of this blog may post a comment.