I have two Arduino UNO that I can't get to talk to each other. I made the following connections
A <---> B
0(RX) 1(TX)
1(TX) 0(RX)
GND GND
I have then, in my code (running on both boards):
void setup()
{
Serial.begin(9600);
// ...
}
void loop()
{
if (Serial.available() >= 1) {
in_sample_value = Serial.read();
in_sample_available = true;
}
if (out_sample_available) {
Serial.write(out_sample_value);
out_sample_available = false;
}
}
in_sample_value is consumed in a ISR (that also sets the in_sample_available flag to false), out_sample_value is produced in another ISR (that also sets the out_sample_available flag to true). The problem is that both TX leds on both boards are continuously on but the RX leds are completely off on both boards. I know that the ISRs are running because I tested them. Can you see what I'm doing wrong?
Addendum
To create a minimal test-case I just wired together pins 0 and 1 on one of the two boards and ran the following:
void setup() {
Serial.begin(9600);
}
uint8_t count = 0;
void loop() {
Serial.write(count++);
Serial.read();
}
As said above, the TX led is on, the RX led is off.