Hi everyone,
I have a motor driver (Pololu TB6612FNG) on my robot and it's actually not working. But when I connect PWM_A and AIN_2 the motor runs.
On this page (https://www.pjrc.com/teensy/td_pulse.html), they say that you need a transistor. Is this also when you have a motor driver?
This is my code:
I can post a photo of the wiring if you want, but it's in my robot and it will not be clear at all. I checked it many times, so I know it's correct.
Thanks in advance.
I have a motor driver (Pololu TB6612FNG) on my robot and it's actually not working. But when I connect PWM_A and AIN_2 the motor runs.
On this page (https://www.pjrc.com/teensy/td_pulse.html), they say that you need a transistor. Is this also when you have a motor driver?
This is my code:
Code:
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT); // pin 2 is AIN_2
pinMode(3, OUTPUT); // pin 3 is AIN_1
pinMode(4, OUTPUT); // pin 4 is STBY
pinMode(5, OUTPUT); // pin 5 is BIN_1
pinMode(6, OUTPUT); // pin 6 is BIN_2
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
analogWrite(30, 255); // pin 30 is PWM_A
analogWrite(29, 255); // pin 29 is PWM_B
}
I can post a photo of the wiring if you want, but it's in my robot and it will not be clear at all. I checked it many times, so I know it's correct.
Thanks in advance.