Hi
I have an Arduino Uno connected via USB to my computer. There is a wire connection pin 8 to Tx and pin 9 to Rx. I am running the example sketch for AltSoftSerial:
#include <AltSoftSerial.h>
// AltSoftSerial always uses these pins:
//
// Board Transmit Receive PWM Unusable
// ----- -------- ------- ------------
// Teensy 3.0 & 3.1 21 20 22
// Teensy 2.0 9 10 (none)
// Teensy++ 2.0 25 4 26, 27
// Arduino Uno 9 8 10
// Arduino Leonardo 5 13 (none)
// Arduino Mega 46 48 44, 45
// Wiring-S 5 6 4
// Sanguino 13 14 12
// This example code is in the public domain.
AltSoftSerial altSerial(8,9);
void setup() {
Serial.begin(9600);
while (!Serial) ; // wait for Arduino Serial Monitor to open
Serial.println("AltSoftSerial Test Begin");
altSerial.begin(9600);
altSerial.println("Hello World");
}
void loop() {
char c;
if (Serial.available()) {
c = Serial.read();
altSerial.print(c);
}
if (altSerial.available()) {
c = altSerial.read();
Serial.print(c);
}
}
If I upload the sketch with the wires connected, I get a crazy output on serial monitor and baud rate is 9600 - see attached picture.
If I disconnect the wires, then upload sketch, then re-connect wires, serial monitor displays "AltSoftSerial Test Begin". When I send any characters via serial monitor, nothing happens.
What is going on?