Saturday, March 2, 2024

bluetooth – Setting flag for sending knowledge by ads utilizing hm-10 mlt bt05 and arduino uno


I’ve succesfully related to my hm-10 machine and began configuring it utilizing AT instructions. I want to know whether it is potential to switch the info despatched in commercial and browse it on one other hm-10 machine indirectly.

I’m utilizing AT instructions specified right here: http://denethor.wlu.ca/arduino/MLT-BT05-AT-commands-TRANSLATED.pdf

And a few from right here (working much less consequently): https://www.rhydolabz.com/paperwork/37/datasheetpercent20HM-10.pdf

That is the machine I’m utilizing: https://elextra.dk/en-gb/p/bluetooth-modul-til-arduino-ble-40-at-09-hm-10/H45653

I’m utilizing Arduino UNO R3.

I can configure the HM-10 module as a slave or grasp, and I can set identify, and verify traits. However I’m having points in setting a flag for the commercial. How is it potential for me to set knowledge that may be broadcasted to all close by bluetooth units (primarily different HM-10 modules). It doesn’t should be loads. I feel the flag is one byte, which is greater than sufficient.

Anyone has the identical downside? Is there anyway to broadcast and browse knowledge with this module with out connecting?

That is my present code for sending AT instructions:

/*
  Software program serial multple serial check

 Receives from the {hardware} serial, sends to software program serial.
 Receives from software program serial, sends to {hardware} serial.

 The circuit:
 * RX is digital pin 10 (connect with TX of different machine)
 * TX is digital pin 11 (connect with RX of different machine)

 Notice:
 Not all pins on the Mega and Mega 2560 help change interrupts,
 so solely the next can be utilized for RX:
 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

 Not all pins on the Leonardo and Micro help change interrupts,
 so solely the next can be utilized for RX:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

 created again within the mists of time
 modified 25 Might 2012
 by Tom Igoe
 primarily based on Mikal Hart's instance

 This instance code is within the public area.

 */
#embrace <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and look ahead to port to open:
  Serial.start(19200);
  whereas (!Serial) {
    ; // look ahead to serial port to attach. Wanted for native USB port solely
  }


  Serial.println("Goodnight moon!");

  // set the info charge for the SoftwareSerial port
  mySerial.start(9600);
  mySerial.println("Hey, world?");
}

void loop() { // run time and again
  if (mySerial.accessible()) {
    Serial.write(mySerial.learn());
  }
  if (Serial.accessible()) {
    mySerial.write(Serial.learn());
  }
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles