Bluetooth multiple button read

I am building a project where i need to read few diffrent button presses from pic microcontroller. I built a scheme with these buttons, connected hc 05 bluetooth module and wrote code for pic, that whenever button is pressed it sends different char. For example if button 1 is pressed, char 1 is send via bluetooth. Maybe someone could help to build an app to display witch button is pressed? I saw a lot of tutorials but all of them shows how to display sensor data. I would be very thankful.

On this webpage, in example 8, a PushButton is shown in Arduino, maybe you can take some ideas.

1 Like

Thank you!
I managed to read one switch that is pressed. Now i need to make six more. My code for microcontroller is that if input is low, it displays that the switch is off, and if input is high, it displays that switch is pressed. Also i have like 1 sec delay between text that is displayed. So basicly inside label the text is changing on my switch presses. Now i have no idea how could i make to show the other switches that is beeing pressed, because for example if i press first and last buttons, in app it will show that first and second button is pressed. Maybe anyone could give some more tips or links where can i find information that would help with this small project. Its my first one and im really exited to complete it!

Maybe anyone can give some tips i cant figure out how to do it. I think its not even possible to make it work

Maybe the last link at FAQ Section: Bluetooth < version 4 (BlueTooth Client) and Arduino ?

1 Like

This code is not exactly what they are looking for, but maybe you can get some idea.

estado ="";
   if (digitalRead(LED12) == HIGH) {estado = "LED12 ON,";} else {estado = "LED12 OFF,";}
   if (digitalRead(LED14) == HIGH) {estado = estado + "LED14 ON,";} else {estado = estado + "LED14 OFF,";}
   if (digitalRead(LED27) == HIGH) {estado = estado + "LED27 ON";} else {estado = estado + "LED27 OFF";}
   pCharacteristic->setValue(estado.c_str()); // Return status
1 Like