Coding for transmitter + Arduino Uno 1
- CODE: SELECT_ALL_CODE
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); //rx, tx
void setup()
{
mySerial.begin(9600);
}
void loop()
{
mySerial.print("hi");
delay(1000);
}
Coding for receiver + Arduino Uno 2
- CODE: SELECT_ALL_CODE
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4); //rx, tx
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
}
void loop()
{
if(mySerial.available())
{
digitalWrite(13, HIGH);
delay(1000);
}
else
{
digitalWrite(13, LOW);
}
}
The result? I'm getting no response at all. The connections all are correct. I intend to use Arduino Mega at first, but I saw a lot of people saying it's not compatible with hardware serial. Hmm, is there any more organized tutorial available out there?