From linear to exponential PWM output

Techylah,

Also, you might like the following old trick to produce a quick and dirty graph view.
For each line "lookupTable[0] = 0;" also print before the CR a series of asterisks, their number (for 51 asterisks being 100%, or 255) being
numAsterisks = lookupTable / 5;
The linear and curved portions should be readily apparent (when you tilt your head 90 deg clockwise. :slight_smile: )
Cheers!

I start with the graph function first and possible without turning the head CW :slight_smile:
So I can see what is happening first with Y and X switchpoint and later with expo curves.
I added the VB6 standard MSchart object to the VB6 project of the control panel.

Looked for some snippet code and cooked something like this.

Private Sub Timer1_Timer()
'Declare 2D array to store values for the chart
'Variant ----so that can store both text as well as numbers
Dim X(1 To 2, 1 To 2) As Variant
 
X(1, 2) = "Speed"
X(2, 2) = 0
X(2, 2) = TextStartSpeedValue.Text

X(2, 1) = "TRIGGER"
X(2, 2) = TextSwitchpointXValue.Text

MSChart1.ChartData = X
MSChart1.chartType = 3
End Sub

What I cant work out is creating the line from startspeed point at the Y-axis to the X/Y point to the 255,255 point in the rigth hand top corner.
So startspeed,deathbandvalue to switchpointYValue, switchpointXValue to 255,255
So there should be three datapoints plotted in the graph.
I know it is quite simple but working for 3 hours with try and error this is all it brought me.

Variable names differ from Arduino slightly but mean the same thing.

Paco