RF 2 ways communicatoin

Hello I new here
Please Help me for 2 ways communication.I use 2 Arduino , pair RF , push button and Leds. For 1 ways communication I successfully but 2 way i have a problems.I hope You can help me

Here is my coding
Transmitter
//----------------------transmitter--------------------//
#include <VirtualWire.h>

int button_gate = 3;

int button_gate_read = 0;
//----------------------receiver-------------------------//
#include <VirtualWire.h>

void setup() {
//--------------------transmitter-------------------------//
Serial.begin(9600);

pinMode(button_gate, INPUT);

vw_setup(2000);
vw_set_tx_pin(6);
//-----------------------receiver------------------------//
pinMode(13,OUTPUT);
digitalWrite(13,LOW);

vw_setup(2000);
vw_set_rx_pin(7);
vw_rx_start();

}

void loop() {
// put your main code here, to run repeatedly:
//------------------------receiver----------------------//
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 == ‘on_01’)

  • {*
  • digitalWrite(13,HIGH);*
  • }*
    else if(buf == ‘off_01’)
    * {*
    * digitalWrite(13,LOW);*
    * }*
    * }*
    * }*
    //--------------------------trasnmitter------------------//
    char on_1[100] = {‘on_2’};
    * char off_1[100] = {‘Off_2’};*

* button_gate_read = digitalRead(button_gate);
if (button_gate_read == HIGH)
_
{*_

vw_send((uint8_t )on_1, 100);
_
}_
else if (button_gate_read == LOW)
_
{*_

vw_send((uint8_t )off_1, 100);
_
}*_

}
Receiver
//----------------------transmitter--------------------//
#include <VirtualWire.h>
int button_gate = 3;
int button_gate_read = 0;
//----------------------receiver-------------------------//
#include <VirtualWire.h>
void setup() {
//--------------------transmitter-------------------------//
Serial.begin(9600);
* pinMode(button_gate, INPUT);
vw_setup(2000);
vw_set_tx_pin(6);
_
//-----------------------receiver------------------------//_
_
pinMode(13,OUTPUT);_
_
digitalWrite(13,LOW);*_

* vw_setup(2000);
vw_set_rx_pin(7);
vw_rx_start();
_
}_
void loop() {
_
// put your main code here, to run repeatedly:_
_
//--------------------------trasnmitter------------------//_
char on_2[100] = {‘on_01’};
char off_2[100] = {‘off_01’};*

* button_gate_read = digitalRead(button_gate);
if (button_gate_read == HIGH)
_
{*_

vw_send((uint8_t )on_2, 100);
_
}_
else if (button_gate_read == LOW)
_
{*_

vw_send((uint8_t )off_2, 100);
_
}_
_
//------------------------receiver----------------------//_
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 == ‘on_02’)
_ {
digitalWrite(13,HIGH);
}
else if(buf == ‘on_02’)
{
digitalWrite(13,LOW);
}
}
}
}*_

Please read the "How to use this forum" post and follow the directions. Edit your post to add code tags.