while (mySerial.available() > 0) {
currentRead = mySerial.read();
mySerial.write(buttonStatus);
}
If there is incoming serial data to read, read it AND send the value in buttonStatus, even though you haven't read the status of a button (or switch, either).
Why?
Why are you sending data before you have assigned a meaningful value to buttonStatus?
Why does sending that data depend on having received data? Why is the app sending data that you don't use?
i want use this on my car to get status of doors and lights whatever. so if one of pins are activated that send data over Bluetooth and show up on my app phone>
i want use this on my car to get status of doors and lights whatever. so if one of pins are activated that send data over Bluetooth and show up on my app phone>
So, why are you sending data first, and then seeing if there is anything you should send?
Why are you only sending data if you have gotten data from the phone?