robot project

void scanArea(int pos , int delTime){
  int result;
  myServo.write(pos);
  delay(delTime);
  result = sonar.ping_cm();
  return result;
  }

Exactly as UKHeliBob said. You have declared the function void but try to return an int.

Please use code tags when posting code. See the post 'How to use this forum' at the top of each board