Compiling works fine but Uploading takes forever

I have used Arduino for some time now but have never encountered this kind of error before.
My code gets compiled fast, but then just says Uploading... forever. Same story even for other programs like Blink.

Here is the code:
const int trigPin = 4;
const int echoPin = 2;
const int trigPin2 = 6;
char incomingByte;
char val, val2;
const int echoPin2 = 7;

void setup() {
// initialize serial communication:
Serial.begin(9600);
}

void loop()
{
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

pinMode(trigPin2, OUTPUT);
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);

// Read the signal from the sensor: a HIGH pulse whose
// duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(echoPin, INPUT);
pinMode(echoPin2, INPUT);

val = digitalRead(echoPin);
val2 = digitalRead(echoPin2);

if (val && val2 == HIGH)
{
Serial.println("Obstruction!");
}

if (Serial.available() > 0) { // if the data came
incomingByte = Serial.read();
}
// read byte
if(incomingByte == '0') {
digitalWrite(trigPin, LOW);
digitalWrite(trigPin2, LOW);
Serial.println("The system is OFF."); // print message
}}

The message I got is: avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

Any help would be appreciated.

coolcheetah:
I have used Arduino for some time now

..... but still don't use code tags :smiling_imp:

coolcheetah:
My code gets compiled fast, but then just says Uploading... forever.

Uploads in no time flat, for me.

coolcheetah:
Same story even for other programs like Blink.

Then it's not the code. I find if I ever get those avrdude not in synch errors, resorting to powering the laptop down and back up, does the trick

@JimboZA - Sorry for the inconvenience :D. Anyway, I restarted my computer, but it still doesn't work.

I think the HC-05 Bluetooth module is the problem. The instant I took it off, everything worked fine.

The problem is, I need the Bluetooth module. Any suggestions?

Probably then that you're using pins 0 and 1 for the BT, which the Arduino needs to upload.

Leave the BT off until it's uploaded, or move the BT to two other pins and use SoftwareSerial.