How to send data from hc-06 to android app?

I want to create an app that if LED is on or off using a push button, it will display at the app. Can anyone please help me with the coding for the arduino & how to make the app using mit app inventor 2? Thank you :slight_smile:

Can anyone please help me with the coding

What does this have to do with the Arduino web site? The Arduino forum?

How did the LED get to be on? Off? Reading the state of the switch is trivial - digitalRead(). Sending data is usually done using Serial.print(), IF there is some way to get the serial data to to the Android, such as a properly paired bluetooth device.

Writing the code for the Android is NOT something you'll get help here doing. The Android forum won't help you write Arduino code, either.

Because i am using arduino for the hc-06 bluetooth module. i just want to know what is the coding to send the data from the hc-06 if the LED is on.

 if (LED == HIGH)

What do i need to write after that to send the data from hc-06?

What do i need to write after that to send the data from hc-06?

From the hc-06? I'd expect you to send data TO the hc-06.

Bluetooth just passes along what it receives. Arduino is not sending data to bluetooth. It is sending data to the serial port, and bluetooth just happens to be the item connected to the other side. Arduino neither knows nor cares what is connected, if anything, and the code is the same. All you need do is ensure the code is sent at the rate at which Bluetooth is set to receive it.

have a look at