Need HELP on sketch

Hi,

I am new to Arduino coding and I need a little help here.

I have set up a transmitter and receiver separately using two NANO as my board and a HC05(Master) and HC06(Slave).

The scope of the project is to control the LED at the Slave end using a button at the Master side.

Once the button at Master side is depressed, the LED at the Slave end should be lighted up and goes off when the button is released.

Any advise is welcome.

Thanks in advance.

Master Coding

int button 8; int buttonState = 0;

Void setup() { pinMode(button, INPUT); Serial.begin(38400); }

Void loop() { if(Serial.available() > 0) { state = Serial.read(); }

buttonState = digitalRead(button); if (buttonState == HIGH) { Serial.write('1'); }

else { Serial.write('0'); } }

Slave Coding int LED = 12;

Void setup() { pinMode(LED, OUTPUT); digitalWrite(LED, LOW); Serial.begin(38400); }

Void loop() { if(Serial.available() > 0)

{ state = Serial.read(); }

if (state == '1')

{ digitalWrite(LED, HIGH); state = 0; }

else if (state == '0')

{ digitalWrite(LED, LOW); state = 0; }

}

"void" is spelled with a lower-case 'v'.

The compiler probably told you that.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R