Piston/actuator/servo

Hello all.

I'm trying to essentially push something back and forth, but I would need to stop it at different points. I'm just wondering what the best device is to use. It only needs to be able to push 3 inches, and push a light about of weight (less than 2 lbs).

Also, preferable easy to program. I'm pretty new here.

Thanks!

If the movement does not require much force, a servo might do the job.

A servo would, but it needs to be in a straight line.

A servo would, but it needs to be in a straight line.

Use a guide with the object to ensure it moves in a straight line.

Do you have any examples? Pictures, video, I understand the concept, but do not know how to execute if.

DavidGascon: Do you have any examples? Pictures, video, I understand the concept, but do not know how to execute if.

You may need to post pix of your setup as I only know that an object weighing 2 pounds need to be moved three inches in a straight line. Think of a piston and a crank shaft, where your object is the piston and the servo is the crank shaft that will move the piston by rotating back and forth 180 deg.