 
 int32_t centerSteering(int32_t maxLeft, int32_t maxRight)
 {
-  int center = (maxLeft - maxRight) / 2;
+  int32_t center = (maxRight - maxLeft) / 2;
   evshield.bank_b.motorRunDegrees(SH_Motor_2, SH_Direction_Forward, 100, center, SH_Completion_Wait_For, SH_Next_Action_Float);
   delay(5000);
   return center;

#include <EVShield.h>
#include <EVShieldAGS.h>
#include <EVs_EV3Infrared.h>

/* Init Shield */
EVShield evshield(0x34, 0x36);

  Serial.println ("Press GO button to calibrate steering");
  evshield.waitForButtonPress(BTN_GO);
  
  maxSteerRight = setMaxRight();
  Serial.println("Max Right Steering Value: ");
  Serial.println(maxSteerRight);
  delay(1000);
  
  maxSteerLeft = setMaxLeft();
  Serial.println("Max Left Steering Value: ");
  Serial.println(maxSteerLeft);
  delay(1000);
  
  centerSteer = centerSteering(maxSteerLeft, maxSteerRight) - maxSteerRight;
  Serial.println("Center value: ");
  Serial.println(centerSteer);
  delay(500);
  Serial.println ("Press GO button to Start Car");
  evshield.waitForButtonPress(BTN_GO);
  
