Bluetooth and 433MHz transmitter communication

Hi guys.

I am a massive noob at arduino coding :stuck_out_tongue: but anyway.

I am trying to create a simple home automation station at the moment , Its only controlling lights at the moment via 433MHz, Bluetooth and my phone i will be adding a touchscreen LCD and other control options later on but for the moment i just want to get this working.

I am wanting this setup so when i connect to the main station via my phone and bluetooth i can send a 1 over bluetooth and when the main station receives it i want it to communicate with the receiver that controls the light and turn it on, But i am having a bit of trouble working out this error:
and was wondering if you guys could help me get this sorted, Error and source code below.
If i have missed anything give me a shout and i will respond asap.

sketch_feb22a:28: error: expected unqualified-id before ‘{’ token
expected unqualified-id before ‘{’ token

#include <VirtualWire.h>
char *controller;
int state = 0;

void setup() {
 vw_setup(50);// speed of data transfer 
void loop() {

 if(Serial.available() > 0){
 state =;

 if (state == '1') {
vw_send((uint8_t *)controller, strlen(controller));
 else if (state == '0') {
vw_send((uint8_t *)controller, strlen(controller));

You appear to be putting { and } in randomly, instead of as needed.

Put every { on a new line. Properly indent the code between the opening { and the closing }. When you do, at some point you'll figure out that the number of { and the number of } in your code are not the same. They must be.

controller is a pointer that does NOT point to usable memory. It is pointless to try to get the length of the string pointed to, and to send the data in that memory.

What is it you think you are sending?

I have fixed the issue with the {} i re wrote it and now its compiling correctly. I must have been pretty tired when i was creating the first code, as i missed out a fair bit of code :P. all good now though, now just to see if it works when im home from work :confused: