Go Down

Topic: how to control L12 Linear Actuator using Arduino Mege 2560? (Read 9888 times) previous topic - next topic

JimboZA

Quote
is there a specific sequence i am not following?


We can't see what you are doing since you're not posting code.

But the general approach is to output a high and a low on whatever pins go from the Arduino to the motor boards direction control pins, then to reverse you swop the high / low to be low / high. You would put a delay between the two to let it run for a short while.

Something like this: 

Code: [Select]
int ControlPin1 = 9; // or whatever
int ControlPin2= 10; // or whatever

void setup()
{
pinMode(ControlPin1, OUTPUT);
pinMode(ControlPin2, OUTPUT);
}

void loop()
{
//forward
digitalWrite(ControlPin1, HIGH);
digitalWrite(ControlPin2, LOW);
delay(500); // or however long it takes to extend

//backward
digitalWrite(ControlPin2, HIGH);
digitalWrite(ControlPin1, LOW);
delay(500); // or however long it takes to retract
}



Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Go Up