title: Arduino Uno serial monitor printing garbage
body: <p>I am using an Arduino Uno and GSM sim800l for a project. It looks like something is wrong and I don't know what it is. Here is my code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;AltSoftSerial.h&gt;
  
  AltSoftSerial altSerial;
  
  void setup() {
    Serial.begin(19200);
    Serial.println(&quot;AltSoftSerial Test Begin&quot;);
    altSerial.begin(19200);
    altSerial.println(&quot;Hello World&quot;);
  }
  
  void loop() {
    char c;
  
    altSerial.print(&quot;altSerial is working.&quot;);
    if (Serial.available()) {
      c = Serial.read();
      altSerial.print(c);
    }
    if (altSerial.available()) {
      c = altSerial.read();
      Serial.print(c);
    }
  }
  </code></pre>
  <p>Its output was like this:</p>
  <pre class="lang-none prettyprint-override"><code>AltSoftSerial Test Begin (linebreak)
   Hello World  (linebreak)
  ltSerial is ok⸮⸮M⸮ɥ⸮⸮⸮is okalt //insert long random garbage here
  </code></pre>
  <p>I tried changing the baud rate of the code and serial monitor to keep it matched, but it is not working. I tried to lower it as low as 300 and tried up to <a href="https://en.wikipedia.org/wiki/Serial_port#Settings" rel="nofollow noreferrer">19,200 baud</a> as well.</p>
  <p>I also tried menu <em>Tools</em> → <em>Fix encoding</em> and reload, but it still didn't solve the problem. It is my first time using this type of hardware, so please bear with me. My goal is to use it to send SMS messages. but right now I'm trying a smaller task with it to try and understand it better.</p>
  <p>The Arduino IDE version I am using is 1.8.7.</p>