Wanting to add an accel and decel function to a Motor Controller

You have some code you want us to look at?

To accelerate, you, obviously, start with a speed of 0 and gradually increase the speed until you are going full speed. How gradually? Well, you didn't tell us if you want to take 3.65432 seconds or 3000 years.

To decelerate, you do the same, except you step the speed down instead of up.