Here an example:
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
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 , 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
App inventor does not work with Services, the app must always be active in the foreground.
There are extensions you can try to work with services, but you'll need to test them.
There are also extensions to create Notifications.
To turn on an LED from the app, you can use the examples that I have put in the HM-10 tutorial.
pinMode(7,INPUT);
pinMode(13, OUTPUT);
Serial.println("Pulsado");
digitalWrite(13,HIGH);
Serial.println("NO");
digitalWrite(13,LOW);
I think my problem has already been solved, but I only have two more questions
-
Where do I download the kio04 extension
-
and finally if it would be possible to change the message when I press the button, instead of being 0 or 1 in the app I would like it to be another type of message like "nobody is calling now" or "they need help" is it possible?
http://kio4.com/appinventor/242_extension_bluetooth.htm
in blocks
Set a new Label
if compare text stringValue = (1)
LabelX.Text = "they need help)"
else
LabelX.Text = "nobody is calling now"
Could you send a screenshot? Of course, if possible.
you are angel
I already managed to do my project, thank you very much. Just one more question, would you be able to put a message on the i2c lcd that says "connect your device to bluetooth hm-10"? How would I make the arduino recognize that it really connected to bluetooth?