I have been working on a project in which I use a model aircraft transmitter and receiver to control servos. I am not plugging the servos directly into the receiver because I want to reverse/expo the servos without buying a new transmitter. The outputs from the receiver fluctuate a little bit and this causes the servo to be very jittery. Is there a way to round the microsecond output (1000-2000 microseconds) to the nearest 10? 1400 1410 1420 instead of 1401 1407 1417.
Here are some of the outputs from my receiver.
1518 1540 1521 1540 1518 1537 1515 1534 1472 1469 1515
I tried using the round() function but I think that it is only for decimals. I also was thinking of taking the last 10 outputs from the receiver and averaging them but I am unsure how to do this. Any help is much appreciated. THANKS!