I've got the following:
#include <SoftwareSerial.h>
const int rx = -1;
const int tx = 4;
SoftwareSerial mySerial(rx, tx);
void setup()
{
mySerial.begin(2400);
pinMode(tx, OUTPUT);
}
void loop()
{
if(mySerial.available())
{
String data = "Hello World";
for(int k = 0; k < data.length(); k++ )
{
mySerial.write(0xAA);
mySerial.write(data[k]);
}
mySerial.write(0xA9);
}
delay(1000);
}
Which I'm trying to send to to a RF transmitter module. It all compiles just fine, but am I forgetting something? And does pin 4 = physical pin 3?