working freewheeling, no brake

This commit is contained in:
interfisch 2019-12-29 01:49:49 +01:00
parent 3dd5549f82
commit 4b522c73e8
1 changed files with 5 additions and 1 deletions

View File

@ -451,7 +451,11 @@ void loop_idle() {
}
void loop_on() {
int16_t speedvalue=constrain( map(adc_throttle, ADC_CALIB_THROTTLE_MIN, ADC_CALIB_THROTTLE_MAX, 0, 1000 ) ,0, 1000);
int _maxspeed=1000;
if (MODESWITCH_DOWN) {
_maxspeed=200;
}
int16_t speedvalue=constrain( map(adc_throttle, ADC_CALIB_THROTTLE_MIN, ADC_CALIB_THROTTLE_MAX, 0, _maxspeed ) ,0, _maxspeed);
/*int16_t lastSpeed=(out_speedFL+out_speedFR+out_speedRL+out_speedRR)/4;
if (speedvalue<=lastSpeed) { //braking