How to use RF links transmitter with Arduino uno?

this is a link that leads to

this is a link that leads to it :

http://www.google.com.lb/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&ved=0CDUQFjAC&url=http%3A%2F%2Fwww.elecrow.com%2Fwiki%2Fimages%2F2%2F2f%2FVirtualwire_introduction.pdf&ei=lnquUY7XNovjtQb834DgBQ&usg=AFQjCNG_cgrmXlMb_Wuzvef2AgQal9WzYw&sig2=XPgWB_PoDGqeLFJiNbJhgA&bvm=bv.47380653,d.Yms

it’s not working at all

it’s not working at all !!

what i did is this i took the example from the link you gave me and i read the tutorial and connect the Transmiter and Receiver as said and i plugged the LED into the pin 13 from the receiving arduino !! and about the T and R i plugged their Data pin into pin 0 and pin 1 from the arduinos, i opened the serial monitor for the arduino connected to transmitter and i typed 1 to make the LED turns on but nothing happened !!

i found this great tutorial

well it worked except not everytime i hit 1 the LED turns on, so i must hit it again !! and same for off

i found a great tutorial on youtube which uses exactly the same RF Link which i am using exactly the same

here is the link for the tutorial if anyone is interested and thank you again Chris and everyone who tried to help thanks a lot :slight_smile: :

https://www.youtube.com/watch?v=e8RhXtst7ME

i was controlling the LED by

i was controlling the LED by pc, but now i am trying to do it by a push button connected to transmitter arduino

but it didn’t work, cz maybe i didnt know what to write in my codes i eliminated the serial commands do i have to leave it or it’s just when talking with the pc ?

here is my code for transmitter :

// TRANSMITTER CODE

#include <VirtualWire.h>

int switchPin = 13;
int transmittPin = 7;
boolean lastButton = LOW;
boolean currentButton = LOW;
boolean transmittOn = false;

void setup()
{
    Serial.begin(9600);      // Debugging only
   
    pinMode(switchPin, INPUT);
    pinMode(transmittPin, OUTPUT);
    vw_setup(2000);     // Bits per sec
    vw_set_tx_pin(7);

}

boolean debounce(boolean last)
{
  boolean current = digitalRead(switchPin);
  if(last != current)
  {
    delay(5);
    current = digitalRead(switchPin);
  }
  return current;
}

void loop()
{
   currentButton = debounce(lastButton);
   if(lastButton == LOW && currentButton == HIGH)
   {
     transmittOn = !transmittOn;
   }
   lastButton = digitalRead(switchPin);
   digitalWrite(transmittPin, transmittOn);
}

 

and this for the receiver :

 

/* RECIEVER CODE*/
 
#include <VirtualWire.h>

void setup()
{
   pinMode(13, OUTPUT);
   digitalWrite(13, LOW);
 
   vw_setup(2000);
   vw_set_rx_pin(7);
   vw_rx_start();
}

void loop()
{
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  uint8_t buf[buflen];
 
  if(vw_get_message(buf, &buflen))
  {
    for(int i = 0; i < buflen; i++)
    {
      if(buf[i] == HIGH)
      {
        digitalWrite(13, HIGH);
      }
      else if(buf[i] == LOW)
      {
        digitalWrite(13, LOW);
      }
    }
  }
}

I’m just thinking out loud here.

Could you remove the radios from your current setup and just wire the two arduinos together? Just to make sure your code is doing what you believe it should do?

well i found a good blog on

well i found a good blog on google after searching for hours

so i used the codes with other one from a tutorial and introduced my own stuff so it worked finally by the switch button :smiley:

 

PURPOSEFUL THREAD HIJACKING

(all other people except the original author of this forum post can safely ignore this message)

What’s up with the “secret messaging”?? those kind of questions, can and should be be posted out in the open.

 

P.S. - I won’t be notified of any reply to this particular message (or thread). So if you have a question please do ask it in the right place.

 

Happy Easter Cabbages \o