just out of curiosity, does the software serial library give the transmitter the start bit to make it send a message? i'd like to try and not have to learn the virtual wire library since i read the complete pdf, and i don't understand how to use the functions, and how to change them to do what i want.
edit:
so i tried the software serial library, and it kinda worked..... kinda....
when something is not connected, then like you said, it spits out garbage, that i don't mind, but i know it connects since it stops spittng out garbage when i have everything connected. but what it does print out is still garbage. it's indiciferable. but i definitly know it can see it! that's a big leap, it means it's really close to working!
i altered the code just for the transmitter to send numbers instead of read the switchs, so that may have screwed up the reciever's stuff...
edit edit:
still not working, so i'll post my transmit code and reciever code to see if the code is the problem... just as before, when the two devices are connected, the reciever stops getting tons of garbage, and get's characters of garbage, so i know they recognize one another. now that i changed it to DEC i just get zeros most of the time instead of data... and i did debug my transmit data, it sends out a new number every second...
Transmit code:
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
#define buttonPin 12
#define ledPin 13
// set up a new serial connection for communicating with RF transmitter
// (this also frees up Arduino's built in serial port for PC communication)
SoftwareSerial rfSerial = SoftwareSerial(rxPin, txPin);
byte onState = 99;
void setup() {
pinMode(ledPin, OUTPUT); // declare led as output
rfSerial.begin(4800); // our RF Link is a 2400 baud model (make sure you check this!)
Serial.begin(4800);
// start by blinking high and then low so we can tell the setup routine has been completed
digitalWrite(ledPin,HIGH);
delay(1000);
digitalWrite(ledPin,LOW);
}
void loop(){
onState++; // check if the input is HIGH (button pressed)
rfSerial.print(onState, DEC);
delay(1000);
}
receive code:
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
#define ledPin 13
SoftwareSerial rfSerial = SoftwareSerial(rxPin, txPin);
int someChar = 0;
void setup()
{
pinMode(rxPin, INPUT); // set up pins for serial comm. with RF receiver
pinMode(ledPin, OUTPUT);
rfSerial.begin(4800); // begin serial connection with RF Link unit
Serial.begin(4800);
digitalWrite(ledPin,HIGH); // turn on LED
delay(1000);
digitalWrite(ledPin,LOW); // turn off LED
}
void loop()
{
someChar = rfSerial.read();
Serial.print(someChar, DEC);
delay(1000);
Serial.println("-----");
}
and that gives me in the serial port something like this:
"
0------
0------
255------
0------
0------
0------
246------
0------
0------
72------
0------
0------
0------
0------
0------
0------
"
and when i disconnect the transmitter, it just sends random values, almost none of which are zeroes...