Arduino uno does connect but does not respond to code

Hi,
for a school project I am building an Arduino Uno robot, the goal is to make it an object avoiding robot using an ultrasone sensor. We are writing the code step by step, so the first one was to just go forward. Our code is correct and should work, and we have selected the usb port and right arduino board, when we update the code onto the arduino it won't finish downloading.
We use a mac computer if that makes a difference for the advice.

Your code could be to big. This is answered in the FAQ's.

trgtdrone:
Your code could be to big. This is answered in the FAQ's.

How on Earth did you get to this conclusion from the 0 data you were provided :|?

OP: Please upload your code (use code tags [ CODE ] paste your code here [ / CODE ]) and also tell us what the error is in the IDE when the arduino stops "downloading" the code.

Hi,
The problem is that the program doesn't show an error while downloading the code, so the upload was completed every time and the motorboard also responded to the uploaded code, but the wheels wouldn't move. We started out with the easiest code possible, just trying to let the robot drive in a strait line, so the code could not have been to big.

Hereby the code:
//variabelen
const int MR1 = 5;
const int MR2 = 6;
const int ML1 = 7;
const int ML2 = 8;
const int MRPWM = 4;
const int MLPWM = 9;
int Speed = 255;

// HIGH LOW = Vooruit
// LOW HIGH = Achteruit
// LOW LOW = Stoppen

void setup() {
//pin
Serial.begin(9600);
pinMode(MR1, OUTPUT);
pinMode(MR2, OUTPUT);
pinMode(ML1, OUTPUT);
pinMode(ML2, OUTPUT);
pinMode(MRPWM, OUTPUT);
pinMode(MLPWM, OUTPUT);
}

void forward(int d) {
digitalWrite(MR1, HIGH);
digitalWrite(MR2, LOW);
digitalWrite(ML1, HIGH);
digitalWrite(ML2, LOW);
analogWrite(MRPWM, Speed);
analogWrite(MLPWM, Speed);
delay(d * 10);
}

void loop() {
// put your main code here, to run repeatedly:
forward(10);

}

I also put it in an attachment in case anyone has the programm installed on their computer. We already checked whether the pins were appointed correctly en the program showed no errors while uploading or running it.

Thanks for your help!

Robot_1-11.ino (675 Bytes)