Hello,
I'm fairly new to Arduino stuff and am having some trouble. I currently have a Mighty Zap Mini Linear Actuator Servo connecting to a RobotGeek Sensor Shield (that is placed on top of an Arduino Uno board). I am trying to get the actuator arm to move 5mm for 5 minutes every hour, and the remaining 55 minutes would be idle. I'm just having all around trouble and need someone to help look at my code to see if I'm even starting at the right place.
This is what it would look like:
Wiring
Linear Actuator - Digital Pin 1
Linear Actuator connected to RobotGeek Sensor Shield Digital Pin 1
RobotGeek Sensor Shield plugged on top of Arduino
Control Behavior:
Preset position for a predetermined time range
Linear actuator has arm that can extend full 30mm stroke
Linear acuator will move actuator arm 5mm for 5 minutes every hour, for the next 55 minutes it will be in rest
This will be continuously run in a loop for multiple days (we will put in 1 month)
***********************************************************************************/
//Includes
#include <Servo.h>
const int LINEAR_ACTUATOR = 1; //Constants won't change, used here to set pin numbers
int linearvalue = 1500; //current positional value being sent to the linear actuator.
Servo LinearActuator; //create servo objects to control linear actuator
void setup()
// put your setup code here, to run once:
{
//initialize servo/linear actuator objects
LinearActuator.attach(LinearActuator); // attaches/activates the linear actuator as a servo object
//use the writeMicroseconds to set the linear actuators to their default positions
LinearActuator.writeMicroseconds(linearValue);
}
void loop()
{
// put your main code here, to run repeatedly
// Preset position of 5mm stroke for 5 minutes
// set the position value
linearValue = [insert value here];
}