I am trying to use PulseIn to read a PPM signal from an RC receiver and then turn it into something useful for a motor driver board. Im not advanced enough yet for interrupts, but I am trying to learn that for the future.
My motor keeps spinning ever so slightly like there is still some signal getting to it.
The serial window shows "ch4" at 1435 when the stick is not moving but "left" fluctuates from 2-20.
Ideas?
ch4 = pulseIn(3, HIGH);
if (ch4 < 1480 && ch4 > 1400) // creates a deadband to stop the motor from
{ //constantly turning
ch4 = 1435;
}
left = map(ch4,1150,1726, -500, 500); //center over zero
left = constrain(left, -255, 255); //only pass values whose absolutes are
//valid pwm values
Thankyou!