Go Down

Topic: Using RX and TX pins. (Read 417 times) previous topic - next topic

Poohshoes

Oct 21, 2008, 06:32 am Last Edit: Oct 21, 2008, 06:36 am by Poohshoes Reason: 1
I have a mosaur transmitter reveiver pair and one arduino decillima for each.

I have been trying to get my transmitter-receiver pair working for a while and was having problems uploading sketches to my receiver board (some avrdude error).  I then relaized that if I remove the pin going into RX the board starts working (though not receiving signals).  So A little searching later and I found that adding a 10K resistor to the input into RX stops the board from stopping working.

Does this also stop the board from receiving signals?  Should the sending board also have a resistor somewhere?

Heres the code on my receiving board:
Code: [Select]

void setup() {

 // for a motor
 pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);
 
 //I am running a motor though an H-bridge, this starts the motor turning
 digitalWrite(2,  LOW);
 digitalWrite(3,  HIGH);
 
 Serial.begin(2400);
}

void loop() {
 
 //if we receive any signal
 if(Serial.available() > 0)
 {
   //consume the serial input so there is no more available
   Serial.read();
   
   //stop the motor for one second
   digitalWrite(2,  HIGH);
   delay(1000);
   digitalWrite(2,  LOW);
 }
}


With the above code the motor will run IF the RX wire is not connected or there is a 10K resistor on it.

And the code on my transmitting board:
Code: [Select]

void setup() {
 
 
 Serial.begin(2400);
}

void loop() {
 
 Serial.print(3);
 delay(5000);
}


I'm not sure if the above transmitter code is working, I am not sure how to debug it and have made it as simple as possible.

Thanks,
Pooh

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy