Linear Actuator Position Control Reed Sensor

Could you please post the working code? as I'm doing something similar. Thank you.