From linear to exponential PWM output

Hi Pete and Rob

I will use the code dont worry.
As getting the formula correct and I like to learn what I am doing (not just copy and paste) I did the homework first in Excel.
Learned today again some valuable stuff in Arduino and Excel world.

I whished the slot car world would be that easy that one fixed curve would do the trick.
All cars and motors behave different on the tracks and then there is also different lanes that require different feel (set up).
So ONE fixed curve positive or negative is a no go.... :slight_smile:

The powercurve should be adjustable (currently is) by push buttons + and - for direct setting on the control handle or through menu structure by display.
The MEGA powered project is still prototype as the power board is still under construction so no real life testing with a motor or at the track.
I currently use two LED's for the PWM output (speed and brake) to see what happens while operating the trigger.
The speedcurveValue now is adjustable from 0 to125 and BYTE declared.
As I need both sides of the curves I have to switch formulas at the 1 value point.
if speedcurveValue = 0.1 to 0.99 then formula positive
if speedcurveValue = 1 to 2 then formula negative
speedcurveValue was initially set up as BYTE length but I guess I have to change all after this line and declare to FLOAT?

Paco