On this years robot we are using an Encoder to tell the Elevator that is placing the tubes the distance it's going up and down, We want the Elevator to slow down when it reaches X height/# of rotations of the motor AKA a Speed Curve. I have no idea how to code this

I don't know how to approch this or where to start

, if you have some sample code to help me get started that would be greatly appriciated.
-Thanks
Sean Teager
__________________
FIRST Team 1403 Cougar Robotics
2008,2009- Programmer
2010,2011- Programming Team Captain
2010,2011- Safety Captain
2010,2011- Drive Team
2012-Present -Mentor