<commit_before>// pre: the diameter of the wheel is motorDiameter
//      the radius to turn is DiameterToTurn
//      the angle the motor should turn could be calculated as 
//      motorDiameter * angleMotor =  angleTurning * DiameterToTurn
// 63 * 3.1416 millimeter per turn
// 63 * 3.1416 / 360 millimeter per degree
// 360 / 63 * 3.1416 degree per millimeter 
// const int motorDiameter = 63; // in millimeter
// const int Pi = 314;

const float mapConstant = 1.8189;

void moveBegin() {
  motorLeft.begin();
  motorRight.begin();

  //turn the PID on
  Input = 0;
  Setpoint = 0;
  myPID.SetMode(AUTOMATIC);
}    

void movePID(int errorInput) {
  // Input need to set to receive info
  Input = errorInput;
  myPID.Compute();
  Serial.println(Output);
  motorRight.runSpeed(carSpeed + Output);
}

// pre: give the distance between two points
void moveForward(int millimeter) {
  int degreeToTurn = millimeter * mapConstant;
  degreeCounterL -= degreeToTurn;<commit_msg>little change<commit_after>// pre: the diameter of the wheel is motorDiameter
//      the radius to turn is DiameterToTurn
//      the angle the motor should turn could be calculated as 
//      motorDiameter * angleMotor =  angleTurning * DiameterToTurn
// 63 * 3.1416 millimeter per turn
// 63 * 3.1416 / 360 millimeter per degree
// 360 / 63 * 3.1416 degree per millimeter 
// const int motorDiameter = 63; // in millimeter
// const int Pi = 314;

const float mapConstant = 1.8189;

void moveBegin() {
  motorLeft.begin();
  motorRight.begin();

  //turn the PID on
  Input = 0;
  Setpoint = 0;
  myPID.SetMode(AUTOMATIC);
}    

void movePID(int errorInput) {
  // Input need to set to receive info
  Input = errorInput;
  myPID.Compute();
  Serial.println(Output);
  motorRight.RunSpeed(carSpeed + Output);
}

// pre: give the distance between two points
void moveForward(int millimeter) {
  int degreeToTurn = millimeter * mapConstant;
  degreeCounterL -= degreeToTurn;
{'fraction_non_alphanumeric': 0.09948717948717949, 'fraction_numerical': 0.04, 'mean_word_length': 3.222943722943723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7434004', 'n_tokens_mistral': 683, 'n_tokens_neox': 604, 'n_words': 210}