Hi!
I would appreciate some advice for a problem I’m encountering.
I purchased a small linear actuator ( PQ12-R by Actuonix) from Robotshop:
For some reason, I am unable to control it in the fashion I would like. I am able to position it at its max and min, and anywhere in between, but I am unable to make the actuator move from its fully retracted position to its fully extended position, and then back to its fully retracted position.
Here is my current arduino code:
//INCLUDES
#include <Servo.h>
//DEFINES
#define LINEARACTUATORPIN 9
Servo LINEARACTUATOR;
int linearValue;
//SETUP
void setup() {
LINEARACTUATOR.attach(LINEARACTUATORPIN, 2000, 1000);
}
void loop() {
//
for (linearValue = 2000; linearValue = 1000; linearValue -= 1) {
LINEARACTUATOR.writeMicroseconds(linearValue);
delay(30);
}
for (linearValue = 1000; linearValue = 2000; linearValue += 1) {
LINEARACTUATOR.writeMicroseconds(linearValue);
delay(30);
}
}
When I run it it only accomplishes the first for loop, and ends their, in its fully extended position. It does not accomplish the second for loop, which was intended to return it back into its retracted position.
Is there something I’m not seeing here?
If help is possible, It would be greatly appreciated.
Hardware concerned:
PQ12-R by Actuonix
Software concerned:
Arduino
Thank you so much in advance!