Need help on linear actuator control

Hi everyone,

I'm currently working on a project that require a linear movement in the actuator. I'm using Arduino Uno & 2A L298P motor shield.

I'm able to move shaft outward but I'm unable to get the shaft move inwards.

I used the following code to move the actuator outwards.

int motorPin1 = 5; int motorPin2 = 6; int motorPin3 = 7; int motorPin4 = 8; int delayTime = 150;

void setup() { pinMode(motorPin1, OUTPUT); pinMode(motorPin2, OUTPUT); pinMode(motorPin3, OUTPUT); pinMode(motorPin4, OUTPUT); }

void loop() {

digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW);

delay(delayTime);

digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH);

delay(delayTime);

digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH);

delay(delayTime);

digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW);

delay(delayTime);

}

Datasheet of the actuator - http://sg.rs-online.com/web/p/electric-linear-actuators/4947234/

Thank you so much!

And your schematic? And the code tags that you would have read about if you could be arsed reading the how to use this forum sticky?