Controlling speed and position with DC Motor Encoder.

I have a DC motor with an incremental encoder attached.
My task:

  1. Control the motor direction, acceleration, and speed in relation to the encoders reading
  2. When the limit switch "A" is pressed the encoder value resets to 0.

What would be the most efficient way to get started? Is there a library or reference specifically for this?
Awesome tutorial for this type of application? I've found multiple resources but I'm not experienced enough to know good from bad, irrelevant or outdated... Any help is appreciated!

Divide your learning into small parts.

Write a short program to read a limit switch and display Off or On in the Arduino Serial Monitor

Write another short program to control the speed of the motor - first based on a data value in your program and then, perhaps, based on a potentiometer.

Write a short program to detect and count pulses and direction from the encoder and display the data on the Serial Monitor.

You should find lots of online advice about each of these.

There are lots of useful links on the Useful Links Thread.

...R