arduino with RF transmitter and receiver (433MHz)

hey everyone,

i am doing arduino based Traffic signal controller, so the project is that when an emergency vehicle(carrying arduino connected with rf trasmitter) approaches to the intersection, the traffic signal light will turn into red( of course with arduino connected with rf receiver). i tried this code from the virtualwire library but everytime i load the code and run it, the receiver side traffic light keeps working even if rf transmitter is on. so please guys help me out this,,,,,my project due is 2 weeks....im totally horrified

New Text Document (2).txt (1.18 KB)

Please post your code.
Don't forget the code tags

Here is the code from the text file attached
Next time,please use Code Tags.click " </> "

RF TRANSMITTER:

#include <VirtualWire.h>
char *controller;
void setup() {
  pinMode(13,OUTPUT);
vw_set_ptt_inverted(true); //
vw_set_tx_pin(12);
vw_setup(4000);// speed of data transfer Kbps
}

void loop(){
controller="1"  ;
vw_send((uint8_t *)controller, strlen(controller));
 // Wait until the whole message is gone
digitalWrite(13,1);


}
controller="1"  ;

You can't do assignments with char strings in C/C++.
For what you are doing, you can initialize it once in setup:

char controller[]= "1";

Don't mess with it in loop(), if you must, then use strcpy().

Also, 4000 bps is known to be unreliable with most modules. Use the default, 2000.