You create the pulses with hardware. D10 is the output. Set OCR1B between 2000 and 4000 to create a continuous 1 to 2 mS pulse train. I can't remember where I found this code, but it works. It goes in the setup function. Take the comments with a grain of salt.
#include <avr/io.h> You might need this include. It would be the very first statement and not within a function.
//start the PWM Subsystem
DDRB = 0b11111111; // ??Set pins 8-13 as outputs
TCCR1A=0b10100010; // ?? Set timer to CTC
TCCR1B=0b00011010; // ??Fast PWM, top in ICR1, /8 prescale (.5 uSec)
ICR1=39999; // Set the frequency. 40,000 clocks @ .5 uS = 20mS = 50Hz
OCR1B=2000; // Set throttle to low value. 2000 clocks @ .5 uS = 1mS
Just as a safety thing, I have a switch on the handle bars that is hard wired to the Arduino reset. It takes the reset pin to ground and holds it there. This assures that if my code runs away, I don't go with it.
Bubba