re: mike, glad i could be of help.
just had another quick question regarding this thread, hoping someone might be able to shed some light.
After getting the linear actuator working with the H-bridge driver SN754410 I had lying around (http://uk.farnell.com/jsp/search/productdetail.jsp?sku=9592997), I wanted to find a more suitable driver that could produce the 2A required for the linear actuator in question (the one i had tested with could only output 1.2A.. and I want to be able to get the maximum out of these motors).
I ordered the following component : http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=403295 - which appears to be able to output 2A (per channel), however I cannot seem to get it to work, should it behave the same way as the other h bridge adapter?
I have wired it up as follows:
output 1 & 2 => motor pins
supply voltage => 12v external supply
input 1 & 2 => arduino pins 2, 3
enable a => arduino
gnd => gnd
logic supply voltage => arduino + 5v
the code i have (same as the one tested succesfully on the SN754410) is real simple :
const int motor1Pin = 2; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 3; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 4; // H-bridge enable pin
const int clutchPin = 8;
void setup() {
// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
pinMode(clutchPin, OUTPUT);
// set enablePin high so that motor can turn on:
digitalWrite(clutchPin, HIGH);
Serial.begin(9600);
}
void loop() {
// if the switch is high, motor will turn on one direction:
if (Serial.available()) {
char ser = Serial.read();
if(ser == 'a'){
digitalWrite(enablePin, HIGH);
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
delay(1200);
digitalWrite(enablePin, LOW);
}
if(ser == 'b'){
digitalWrite(enablePin, HIGH);
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
delay(1200);
digitalWrite(enablePin, LOW);
}
if (ser == 'c'){
digitalWrite(clutchPin, LOW);
delay(100);
digitalWrite(clutchPin, HIGH);
}
if (ser == 'd'){
digitalWrite(clutchPin, LOW);
}
}
}
but i cannot get any response out of the motor, is there a difference in the two h-bridge adapters that i have missed? should i wire this up differently?
any help would be greatly appreciated