Sending 1 & 0 from One arduino to another arduino both connected with Bluetooth module hc-05 and both are paired the receiver side code is here. I need sender side code which is configure as master.
int ledpin = 12;
int state = '2';
void setup()
{
pinMode(ledpin, OUTPUT);
digitalWrite(ledpin, LOW);
Serial.begin(9600);
}
void loop()
{
if (Serial.available() > 0)
{
state = Serial.read();
}
if (state == '0')
{
digitalWrite(ledpin, LOW);
Serial.println("LED OFF");
state = '2';
}
else if (state == '1')
{
digitalWrite(ledpin, HIGH);
Serial.println("LED ON");
state = '2';
}
}