{"id":3523,"date":"2023-07-22T06:26:39","date_gmt":"2023-07-22T13:26:39","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3523"},"modified":"2023-07-22T06:26:39","modified_gmt":"2023-07-22T13:26:39","slug":"project-26-radio-frequency-bluetooth-commands-mk19","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3523","title":{"rendered":"Project #26 &#8211; Radio Frequency &#8211; Bluetooth Commands &#8211; Mk19"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3523-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06a.png\" alt=\"Bluetooth Commands\" width=\"720\" height=\"573\" class=\"alignnone size-full wp-image-3525\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06a-300x239.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06b.png\" alt=\"Bluetooth Commands\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3526\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06c.png\" alt=\"Bluetooth Commands\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3527\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/07\/DL2306Mk06c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>ACTION Commands<\/strong><\/p>\n<p>Begin by sending the inquiry scan command: I,<value>, to search for other Bluetooth modules in range. The <value> parameter defines the number of seconds the modem will take to look for other modules. It&#8217;ll default to 10 if not defined. If you just type &#8220;I&#8221; and click send, the device should respond with a &#8220;Inquiry, COD=0&#8221;, and then after ten seconds it&#8217;ll respond with any Bluetooth modules it found. It will print their information as &#8220;BT address, BT name, COD&#8221;.<\/p>\n<p>If the modem finds any modules, you can try sending the connect command: C,<\/p>\n<address>< to connect to one of them. The modem in the example above found one devices in range, by sending the C,0006664FAE18 command, we can attempt to connect to one of them. After sending the connect command, the device will respond with \"TRYING\", which will be followed by either \"CONNECT failed\" or the connection will be successful. After a successful connection we immediately enter data mode, and the modem becomes a pipeline. Any characters sent from one Bluetooth device will be sent to the other, and vice-versa.\n\n<strong>DL2306Mk06<\/strong><\/p>\n<p>1 x Arduino Uno<br \/>\n1 x SparkFun RedBoard Qwiic<br \/>\n2 x SparkFun Bluetooth Mate Silver<br \/>\n2 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Arduino Uno<\/strong><\/p>\n<p>RX &#8211; Digital 3<br \/>\nTX &#8211; Digital 2<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2306Mk06pr.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #26 - Radio Frequency - Bluetooth Commands - Mk19\r\n26-19\r\nDL2306Mk03pr.ino\r\n1 x Arduino Uno\r\n1 x SparkFun RedBoard Qwiic\r\n2 x SparkFun Bluetooth Mate Silver\r\n2 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Software Serial\r\n#include &lt;SoftwareSerial.h&gt;\r\n\r\n\/\/ Software Serial\r\n\/\/ TX-O pin of bluetooth mate, Arduino D2\r\nint bluetoothTx = 2;\r\n\/\/ RX-I pin of bluetooth mate, Arduino D3\r\nint bluetoothRx = 3;\r\n\/\/ Bluetooth\r\nSoftwareSerial bluetooth(bluetoothTx, bluetoothRx);\r\n\/\/ BTA\r\n\/\/String BTA = &quot;0006664FDC9E&quot;; \r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;26-19&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ isBluetooth\r\n  isBluetooth();\r\n \r\n}\r\n<\/pre>\n<p><strong>getBluetooth.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Bluetooth\r\n\/\/ Setup Bluetooth\r\nvoid isSetupBluetooth(){\r\n\r\n  \/\/ Setup Bluetooth\r\n  \/\/ Begin the serial monitor at 9600bps\r\n  Serial.begin(9600);\r\n  \/\/ Bluetooth\r\n  \/\/ The Bluetooth Mate defaults to 115200bps\r\n  bluetooth.begin(115200);\r\n  \/\/ Print three times individually\r\n  bluetooth.print(&quot;$&quot;);\r\n  bluetooth.print(&quot;$&quot;);\r\n  bluetooth.print(&quot;$&quot;);\r\n  \/\/ Enter command mode\r\n  \/\/ Short delay, wait for the Mate to send back CMD\r\n  delay(100);\r\n  \/\/ Temporarily Change the baudrate to 9600, no parity\r\n  bluetooth.println(&quot;U,9600,N&quot;);\r\n  \/\/ 115200 can be too fast at times for NewSoftSerial to relay the data reliably\r\n  \/\/ Start bluetooth serial at 9600\r\n  bluetooth.begin(9600);\r\n  \r\n}\r\n\/\/ isBluetooth\r\nvoid isBluetooth() {\r\n\r\n  \/\/ If the bluetooth sent any characters\r\n  if(bluetooth.available())\r\n  {\r\n    \r\n    \/\/ Send any characters the bluetooth prints to the serial monitor\r\n    Serial.print((char)bluetooth.read());\r\n    \r\n  }\r\n  \/\/ If stuff was typed in the serial monitor\r\n  if(Serial.available())\r\n  {\r\n    \r\n    \/\/ Send any characters the Serial monitor prints to the bluetooth\r\n    bluetooth.print((char)Serial.read());\r\n    \r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n  \r\n  \/\/ Setup Bluetooth\r\n  isSetupBluetooth();\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>SparkFun RedBoard Qwiic<\/strong><\/p>\n<p>RX &#8211; Digital 3<br \/>\nTX &#8211; Digital 2<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2306Mk06ps.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #26 - Radio Frequency - Bluetooth Commands - Mk19\r\n26-19\r\nDL2306Mk03ps.ino\r\n1 x Arduino Uno\r\n1 x SparkFun RedBoard Qwiic\r\n2 x SparkFun Bluetooth Mate Silver\r\n2 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Software Serial\r\n#include &lt;SoftwareSerial.h&gt;\r\n\r\n\/\/ Software Serial\r\n\/\/ TX-O pin of bluetooth mate, Arduino D2\r\nint bluetoothTx = 2;\r\n\/\/ RX-I pin of bluetooth mate, Arduino D3\r\nint bluetoothRx = 3;\r\n\/\/ Bluetooth\r\nSoftwareSerial bluetooth(bluetoothTx, bluetoothRx);\r\n\/\/ BTA\r\n\/\/String BTA = &quot;0006664FAE18&quot;; \r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;26-19&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ isBluetooth\r\n  isBluetooth();\r\n \r\n}\r\n<\/pre>\n<p><strong>getBluetooth.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Bluetooth\r\n\/\/ Setup Bluetooth\r\nvoid isSetupBluetooth(){\r\n\r\n  \/\/ Setup Bluetooth\r\n  \/\/ Begin the serial monitor at 9600bps\r\n  Serial.begin(9600);\r\n  \/\/ Bluetooth\r\n  \/\/ The Bluetooth Mate defaults to 115200bps\r\n  bluetooth.begin(115200);\r\n  \/\/ Print three times individually\r\n  bluetooth.print(&quot;$&quot;);\r\n  bluetooth.print(&quot;$&quot;);\r\n  bluetooth.print(&quot;$&quot;);\r\n  \/\/ Enter command mode\r\n  \/\/ Short delay, wait for the Mate to send back CMD\r\n  delay(100);\r\n  \/\/ Temporarily Change the baudrate to 9600, no parity\r\n  bluetooth.println(&quot;U,9600,N&quot;);\r\n  \/\/ 115200 can be too fast at times for NewSoftSerial to relay the data reliably\r\n  \/\/ Start bluetooth serial at 9600\r\n  bluetooth.begin(9600);\r\n  \r\n}\r\n\/\/ isBluetooth\r\nvoid isBluetooth() {\r\n\r\n  \/\/ If the bluetooth sent any characters\r\n  if(bluetooth.available())\r\n  {\r\n    \r\n    \/\/ Send any characters the bluetooth prints to the serial monitor\r\n    Serial.print((char)bluetooth.read());\r\n    \r\n  }\r\n  \/\/ If stuff was typed in the serial monitor\r\n  if(Serial.available())\r\n  {\r\n    \r\n    \/\/ Send any characters the Serial monitor prints to the bluetooth\r\n    bluetooth.print((char)Serial.read());\r\n    \r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n  \r\n  \/\/ Setup Bluetooth\r\n  isSetupBluetooth();\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>RTOS<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor, E-Mentor, STEAM, and Arts-Based Training<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2023<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; ACTION Commands Begin by sending the inquiry scan command: I,, to search for other Bluetooth modules in range. The parameter defines the number of seconds the modem will take to look for other modules. It&#8217;ll default to 10 if &#8230; <a title=\"Project #26 &#8211; Radio Frequency &#8211; Bluetooth Commands &#8211; Mk19\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3523\" aria-label=\"Read more about Project #26 &#8211; Radio Frequency &#8211; Bluetooth Commands &#8211; Mk19\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,50,49,38,59,5,287,58,10,43],"tags":[6,242,291,102,4,19,85,24,9,27,264,109,33,34],"class_list":["post-3523","post","type-post","status-publish","format-standard","hentry","category-radio-frequency","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-program","category-arduino-programming","category-projects","category-sparkfun","tag-arduino","tag-bluetooth","tag-bluetooth-commands","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-programming","tag-projects-2","tag-radio-frequency","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3523"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3523\/revisions"}],"predecessor-version":[{"id":3528,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3523\/revisions\/3528"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}