Leonardo not setting up Serial connection

Hi Guys,

I'm getting the weirdest error. I'm pretty handy with arduino, but this is the simplest of problems and I can't seem to solve it.
Basically, my Arduino Leonardo doesn't send over serial, neither does it respond to serial input.

This is my simple sketch:

void setup() {
        Serial.begin(9600);
        while (!Serial); // this is needed for leonardo
        Serial.println("start testing");
}

void loop() {
  delay(1000);
  Serial.println("still testing");
}

I can upload the sketch fine, so the serial port (COM15 in this case) works. When I send data to the Leonardo using the Serial Monitor, the RX light blinks. But the Serial connection is never established, because I can't get the arduino to respond to the data, and also the TX light never flashes. I've tried this piece of code in the loop() function:

  if (Serial.available() > 0)
  {
    char x = Serial.read();
    if (x = 'a')
    {
      digitalWrite(13,HIGH);
    }
    else
    {
      digitalWrite(13,LOW);
    }
  }
}

But it doesn't work.

I've also used a Serial monitor that I made in Visual Studio (C#) where I get the same problem, so know for sure it's not the arduino 1.05 software.

Has anyone had the same problem? Any help would be appreciated!

Nope, that code works perfectly for me on Linux. It could be something specific to Windows though. You could try reinstalling the drivers for the COM port.

No consolation from me either I am afraid. The code works for me on Windows 7 using IDE 1.0.5 and 1.5.6 r2