i have an arduino uno connected to a TB6612FNG motor driver trying to turn a 12V motor but it ain't happening this is the code im using just to see if it works is there something obvious missing because im not the best with code. it has a standby pin which must be set to high in order for the motor to turn if that part is confusing. did i do anything wrong here
const int pwm = 5;
const int in1 = 3;
const int in2 = 4;
const int stanby = 6;
void setup() {
pinMode(pwm, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(standby, OUTPUT);
}
void loop() {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
analogWrite(pwm, 255);
}
groundFungus:
Sparkfun tutorial for that motor driver.
oh yeah i tried that also but didn't work, although because i only have 1 motor i went through and took all the second motor out so i wasn't sure maybe i did something wrong there. i tried this way so i wasn't using their library but just a normal one but also didn't work.
jumpingjimmy:
const int pwm = 5;
const int in1 = 3;
const int in2 = 4;
const int stanby = 6;
void setup() {
pinMode(pwm, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(standby, OUTPUT);
}
void loop() {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
analogWrite(pwm, 255);
}
if your code you did not set 'stanby' HIGH, ie digitalWrite(stanby, HIGH); , to enable the motor outputs.
Hope that helps....