 const int STEER_BASE = 1475;
 const int STEER_MIN = 970;
 const int STEER_MAX = 1930;
-const int STEER_BIAS = 2; //set this to adjust steering
 
 const int THROTTLE_IN = 6;
 const int THROTTLE_OUT = 11;

  else{
    digitalWrite(led, LOW);
  }

}

void enter_manual_mode(){
  Serial.println("Vector79: Manual mode triggered from TX");
  manual_mode = true;
  toggle_LED(LED_GREEN, false);
  toggle_LED(LED_RED, true);
}

void setup() {


//sets the steering angle between -45, 45 for full left /right respectively. set to zero for straight ahead
void set_steer_angle(int angle){
  angle = angle + _STEER_BIAS;
  steering_angle = angle;
  int map_angle = map(angle, -45, 45, 0, 180);
  steering_servo.write(map_angle);
}

//when using the transmitter, map the steering to the TX output
void set_steer_angle_manual(int sp){
  int map_angle = map(sp, STEER_MIN, STEER_MAX, -45, 45);
  set_steer_angle(map_angle);
}

//controls the acceleration/deccelration of the robot. -100 is full break to 100 full gas
void set_throttle_position(int pos){
  throttle_pos = pos;
  
  int map_throttle = map(pos, -100, 100, 1000, 2000);
  //set minimum is 1400 for reverse and 1550 for slow forward
  if (map_throttle < 1200){
    map_throttle = 1200;
  }
  if(map_throttle > _GOVERNER){
    map_throttle = _GOVERNER;
  }

  throttle_servo.writeMicroseconds(map_throttle);
}

