On my Uno-equivalent Arduino, a SoftwareSerial connection (on RX, TX = 8, 9) is working*, while a hardware serial connection to the same device, set up in the same way (but on pins RX, TX = 0, 1) is not working. Why is the hardware serial setup not working?
*By working I mean receiving a byte from the external device
Edit: as a simple example:
void setup() {
Serial.begin(38000);
pinMode(7, OUTPUT);
}
void draw() {
if (Serial.available() > 0) {
Serial.read();
tone(7, 440, 1000);
}
}
The above, using Serial, doesn't work, whereas
#include <SoftwareSerial.h>
SoftwareSerial serial(8, 9);
void setup() {
serial.begin(38000);
pinMode(7, OUTPUT);
}
void draw() {
if (serial.available() > 0) {
serial.read();
tone(7, 440, 1000);
}
}
does work.
I don't know if this helps, but connecting RX/TX through an LED to ground gave me the following, using Serial on (0, 1) and SoftwareSerial on (8, 9):
Serial
RX: bright
TX: bright
SoftwareSerial
RX: dim (but still lit)
TX: bright
Is the fact that RX is dim using SoftwareSerial significant?