I am using an HM-10 for the first time I purchased from DSD TECH. I am going to use this module to control halloween decorations from a central server build on a Raspberry Pi.
Does anybody have any good tutorials on using the DSD TECH HM-10 with an arduino? I am writing the test code on an UNO, but will be migrating to a Nano for implementation.
So far the only application that I have been able to make work is the demo application. WIndows is unable to see the HM-10 when I scan for bluetooth, and any AT commands seem to require a reboot of the chip. I would like to be able to set the AT commands in the setup() function.
I do not think an arduino will control a Hummer model 10. Post a link to technical information on your Hummer, I got over a hundred hits. My neighbor tells me it is a model that did not make production and to ask how you got it.
I saw the post but they stated what it was and posted there code following forum guidelines which you might want to look over again. There are many things with the same or similar description when number and letters are used, that is why we ask for links. Good Luck!
# include <SoftwareSerial.h>
SoftwareSerial HM10(2, 3); // RX = 2, TX = 3
char appData;
String inData = "";
void setup()
{
Serial.begin(9600);
Serial.println("HM10 serial started at 9600");
HM10.begin(9600); // set HM10 serial at 9600 baud rate
pinMode(13, OUTPUT); // onboard LED
digitalWrite(13, LOW); // switch OFF LED
}
void loop()
{
HM10.listen(); // listen the HM10 port
while (HM10.available() > 0) { // if HM10 sends something then read
appData = HM10.read();
inData = String(appData); // save the data in string format
Serial.write(appData);
}
if (Serial.available()) { // Read user input if available.
delay(10);
HM10.write(Serial.read());
}
if ( inData == "F") {
Serial.println("LED OFF");
digitalWrite(13, LOW); // switch OFF LED
delay(500);
}
if ( inData == "N") {
Serial.println("LED ON");
digitalWrite(13, HIGH); // switch OFF LED
delay(500);
digitalWrite(13, LOW); // switch OFF LED
delay(500);
}
}
That is all normal. HM-10 is a BLE device and is in AT mode by default on start up. You can thereby send AT commands in setup until you send a standard serial command. Any further AT commands after that require a reboot.
I believe you should see it OK in windows, but you don't need to pair with it. You may need a proper BLE terminal programme. Check the Martyn Currey website.