When you said PWM is that comparable to 'fading'?
Correct! See the Fade Example
I was under the impression to use an AnalogWrite for that function rather than a DigitalWrite.
I am having a lot of trouble with the programming
As always, I recommend that you break your project into separately-testable parts...
I'd start with the LED stuff, since that's the easy part. Just hard-code the "fake" RPM data into you sketch to test the LED hardware & software.
Then when you build & test the RPM sensor, use the Serial Monitor
to send the input-state, and perhaps some variable-values and/or the RPM to your computer over the USB connection.
When you're confident that the RPM sensor hardware & software are working, you can add the code to detect/calculate acceleration & deceleration, and merge it all together.