int throttle;
int ESC;
void setup() {
Serial.begin(9600);
Serial.println("BEGIN");
Serial.println();
pinMode(25, INPUT);
analogReadResolution (10);
}
void loop() {
if (analogRead(25) > throttle) {
throttle = throttle + 1;
}
if (analogRead(25) < throttle) {
throttle = throttle - 8;
}
ESC = map(throttle, 0, 1023, 0, 255);
Serial.println(ESC);
}