- thrIn = pulseIn(thrPin, HIGH, 25000);
- thr = constrain(map(thrIn, 983, 2000, 0, 255), 0, 255) ;
-
-
+ thrIn = pulseIn(thrPin, HIGH, 25000);
+ if (thrIn != 0 && ailIn > 983 && ailIn < 2000) { // clean up
+ thr = map(thrIn, 983, 2000, 0, 255); // mappato su 8bit per PWM
+ }