I'm testing a really simple patch that just writes a counter value to pin 1 on the Arduino Mega. If I monitor this using the Serial Monitor, the TX LED lights up and I can see the values.
However, if I turn the Serial Monitor off, the TX LED extinguishes, leaving me to wonder if I'm actually outputting anything on the TX pin?!
The reason I ask is that I'm not getting anything on a second Arduino with an RF receiver hooked up. Similarly, the RX LED on the second Arduino doesn't light up at all, even if I connect TX on Arduino 1 directly to RX on Arduino 2 using a wire.
Thanks :')
========
TX code
/*
* Simple Transmitter Code
* This code simply counts up to 255
* over and over.
* (TX out of Arduino Mega is Digital Pin 1)
*/
byte counter;
void setup(){
Serial.begin(2400); // 2400 baud communication
counter = 0;
}
void loop(){
//send out to transmitter
Serial.print(counter);
counter++;
delay(10);
}
========
RX code
/*
* Simple Receiver Code
* (RX into Arduino Duemilanove is Digital Pin 0)
*/
int incomingByte = 0;
void setup(){
Serial.begin(2400); // baud rate
}
void loop(){
// read in values, debug to computer
if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.println(incomingByte, DEC);
}
incomingByte = 0;
}