Looking for ideas or best direction to go in

Let me explain first what I want to achieve

I have a radio Control setup with transmitter receiver and ESC.
I can set the ESC for forwards only or Fwd/Rev with center stick position being off
I dont want center stick off because my transmitter doesnt have self center springs and I dont
want to be searching for the mid point off position
but if I go with the forwards only option I cant reverse if I am stuck in a corner

In the Fwd/Rev option with the PWM width at
1000 micro secs its at full speed reverse
1500 micro secs its stopped
2000 micro secs its full speed forward
and of course inbetween these values its a proportional speed

My thought was set the ESC as Fwd/Rev
Have a second switched channel as a fwd/rev switch
Read the throttle channel on an arduino to get its pulse width
have the arduino re send a pwm signal to the ESC but remapped such that

if the fwd/rev switch is set to fwd then take the input pulse width from 0% - 100% and remap it to
a pulse width out of 1500micro secs - 2000 micro secs which sends it forward at 0 to full speed

If the fwd/rev switch is set to rev then take the input pulse width from 0% - 100% and remap it to
a pulse width out of 1500 micro secs to 1000 micro secs which sends it backwards at 0 to full speed

Thats what I would like to do but dont know how to measure the pulse width coming from the receivers throttle channel . I think its pulsein but I am not sure .
or maybe there are libraries written to do all of this more efficiently
or maybe you know of a much better way altogether

Now if I dont do it myself I wont learn anything so I'm not looking for someone to write it for me but I
would appreciate your ideas and help or generally being pointed in the right direction

Cheers
Don

What you're describing is basically a servo signal - you're probably using a motor known as "continuous rotation servo".

To read the pulse width, pulseIn() is a good function. It is blocking - put an appropriate timeout on it as otherwise you're stuck for a full second if there's no signal coming in.

Thanks for the reply

You wrote What you're describing is basically a servo signal - you're probably using a motor known as "continuous rotation servo".

actually the motor is brushless for a model boat ,

Yes I read up on pulsein since making my post and that looks a likely candidate for reading the throttle setting from the receiver

I also found an answer for the other end outputting to the ESC and controlling direction using
the ESC master library , It allows you to give it a speed from 0-500 which I can map from what I read with pulsein and I can also set a direction fwd or reverse so If I have a variable read the fwd reverse switch I should be good to go , .

I will come back if things dont go as planned

Don