While i was waiting for you to reply , I proceeded to hunt for some help on my own.
This is my current setup : 2 arduinos connected to parallax tranceivers as shown in above photographs from previous post
I came ac-cross this tutorial http://arduino.cc/en/Tutorial/SoftwareSerial which is to see if the RF modules are even communicating.
Now i adapted this code slightly. Here it is ( i split between transmitter and receiver for a start)
For Transmitter
#include <ctype.h>
#define bit9600Delay 84
#define halfBit9600Delay 42
#define bit4800Delay 188
#define halfBit4800Delay 94
byte rtselect = 9;
byte datapin = 8;
byte SWval;
void setup() {
pinMode(rtselect,OUTPUT);
digitalWrite(rtselect,HIGH); // When rtselect is 0 module is in receive mode . When rtselect is 1 module is in transmit mode.
digitalWrite(13,HIGH); //turn on debugging LED
if (rtselect==HIGH)
{pinMode(datapin,OUTPUT);}
if(rtselect==LOW)
{pinMode(datapin,INPUT);}
SWprint(‘h’); //debugging hello
SWprint(‘i’);
SWprint(10); //carriage return
}
void SWprint(int data)
{
byte mask;
//startbit
digitalWrite(datapin,HIGH);
delayMicroseconds(bit9600Delay);
for (mask = 0x01; mask>0; mask <<= 1) {
if (data & mask){ // choose bit
digitalWrite(datapin,HIGH); // send 1
}
else{
digitalWrite(datapin,LOW); // send 0
}
delayMicroseconds(bit9600Delay);
}
//stop bit
digitalWrite(datapin, HIGH);
delayMicroseconds(bit9600Delay);
}
void loop()
{
SWprint(toupper(SWval));
}
FOR RECEIVER
#include <ctype.h>
#define bit9600Delay 84
#define halfBit9600Delay 42
#define bit4800Delay 188
#define halfBit4800Delay 94
byte rtselect = 9;
byte datapin = 8;
byte SWval;
void setup() {
pinMode(rtselect,OUTPUT);
digitalWrite(rtselect,HIGH); // When rtselect is 0 module is in receive mode . When rtselect is 1 module is in transmit mode.
digitalWrite(13,HIGH); //turn on debugging LED
if (rtselect==HIGH)
{pinMode(datapin,OUTPUT);}
if(rtselect==LOW)
{pinMode(datapin,INPUT);}
SWprint(‘h’); //debugging hello
SWprint(‘i’);
SWprint(10); //carriage return
}
void SWprint(int data)
{
byte mask;
//startbit
digitalWrite(datapin,HIGH);
delayMicroseconds(bit9600Delay);
for (mask = 0x01; mask>0; mask <<= 1) {
if (data & mask){ // choose bit
digitalWrite(datapin,HIGH); // send 1
}
else{
digitalWrite(datapin,LOW); // send 0
}
delayMicroseconds(bit9600Delay);
}
//stop bit
digitalWrite(datapin, HIGH);
delayMicroseconds(bit9600Delay);
}
void loop()
{
SWprint(toupper(SWval));
}
Observation 1 ) Based on what I read for the parallax datasheet : A constant HIGH is used to synchronize,two RF modules which I changed ( in the tutorial if was Low)
Observation 2 ) I made it difficult to alter between transmit and receive the module as a safety precaution.
Ideally I should be getting an output on my computer console as the receiving bobot is connected to my system . I know its too much to hope , but well it didnt .
Could you tell me where I could be going wrong ?