Serial.begin() prevents a led changing state

Hello guys,I use standart Uno board connected to my computer via usb cable.There is not any other outer supply voltage connected to my circuit.I am running updated Windows 7 operating system and 1.8.13 Arduino IDE.
Any thoughts on it?

void setup() {
  Serial.begin(); --> if i comment it off,Everything seems to work smoothly
  pinMode(0, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(0, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(0 , LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Pin's 0+1 are used for hardware serial, you should not use those pins for anything else than serial communication.

Thanks mate.I don't know how i fell into that trap.

Sugarpasa:
Thanks mate.I don't know how i fell into that trap.

General Ackbar probably had the same consideration, IT'S A TRAP!! :stuck_out_tongue:

Serial.begin();

and if you do want to use Serial communication, at what speed ?