I can't communicate my Arduino with my app

Potentially yes - depends on how the button works, hence my request for the spec.

1 Like

So how can i solve this? i want the person to click the button and the state of the button to change in the app, but i also want to turn the led off and on by the app :confused:

it's a simple button, you press it and then it goes back to the initial state, it has a resistor connected, a 5v pin and a pin that connects the arduino port 7

Let's think out loud about the requirements:

  1. Person in distress can push a button on the Arduino, which sends a signal via Bluetooth to a paired Smartphone.

  2. This signal also changes the colour of an LED on the Arduino Box.

  3. The signal changes the colour of a button in the App (I suggest it should also play a sound).

  4. The Smartphone User can push the button in the App to switch off the Alert.

  5. When the Smartphone button is pushed, it sends a signal back to the Arduino Box and switches off the LED to indicate that someone has received the signal and will attend the person in distress.

Is that how your Project should work? If not, write a step-by-step as I have done here.

1 Like

OMGGGG THAT'S IT, you read my mind lol

This is exactly what I want, but I'm not getting it.

@ChrisWard

Create a basic application to send an app information to Arduino with HM-10.
Then another basic application to send information from the HM-10 to the app.
Here examples:

But then in the tutorial he is using the hm-10 separately, I have the hm-10 next to the shield, and in the arduino code he is declaring the RX and TX ports, in my case I don't know if I need to declare

Arduino and HM-10 must be connected.
I don't know how they are connected in your shield.
HM-10 has two data terminals TX and RX, you need to locate those terminals and check which terminals on the Arduino they are connected to.
In my examples they are connected to pins 2 and 3 of the Arduino.

@Sett_Lima

Here an example:

1 Like

I just found out that my arduino's TX and RX inputs are 0 and 1, I was able to use the second example from your site successfully, however, when I went to test the button example, I press the button and it doesn't turn red , only green, but on the serial monitor it appears that I am sending it to the app, but even so the color does not change in the app

Sett - one step at a time!

I also tested the example of the 3 leds and I was successful, the problem was only the example of the button. Of the 3 examples that I tested, the one that declared SoftwareSerial BLE1 in the arduino code was the one that I didn't succeed.

You need to be specific in your descriptions. I assume here you mean the App button did not change colour to red?

Yeah he hasn't changed

Sett, are you using a Sketch from Juan now or are you still using Martyn's?

Also, I notice that UUIDs for characteristics are used by the App code. That would normally require the same UUIDs to be defined in the Arduino Sketch, and 'Advertised' on Bluetooth. It could just be a means to an end on the App side and only Serial comms used between the App and Arduino.

for now i'm using juan's sketch and the app too

OK - check all of your wiring, ensure it matches Juan's, and make sure the pin numbers match in the Sketch.

It's late here, I have some sleeping to do :grin:

Change the jumpers to connect the hm-10 to terminals 2 and 3

#include <SoftwareSerial.h>
// El TXD del módulo al pin 2 (RX) del Arduino.
// El RXD del módulo al pin 3 (TX) del Arduino.
SoftwareSerial BLE1(2, 3);

I got Juan :grin:, now how do I join this button and a led? I would also like to turn the led on and off through the app, as if it were an alert, when the person pressed the button, a led would light up and it also looked like a notification on the cell phone and the alert would only disappear when I turned it off on the cell phone