RX/TX not working as intended I am currently working on a project with a HC-06 module. I hooked it up accordingly like so:

Arduino -&gt; HC-06
5V -&gt; VCC
GND -&gt; GND
TX -&gt; RX
RX -&gt; TX


and I ran this code:

void setup() {
  Serial.begin(9600);
}

void loop() {
   Serial.print("test");
   Serial.print("\n");

}


Strangely enough that does not work at all. When I am using neither with or without PC as the power source. When I am using SoftwareSerial like this it works like a charm:

#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(0, 1); // RX, TX

void setup() {
  mySerial.begin(9600);
}

void loop() {

   mySerial.print("test");
   mySerial.print("\n");

}


Can someone please explain why and of course how to fix that?
You are using a Leonardo. Pins 0/1 aren't Serial, they're Serial1.  Serial is the built-in USB connection.

void setup() {
  Serial1.begin(9600);
}

void loop() {
   Serial1.print("test");
   Serial1.print("\n");

}