{"id":3220,"date":"2022-10-22T05:57:34","date_gmt":"2022-10-22T12:57:34","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3220"},"modified":"2022-10-22T05:57:34","modified_gmt":"2022-10-22T12:57:34","slug":"project-16-sound-bluetooth-mk21","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3220","title":{"rendered":"Project #16: Sound &#8211; Bluetooth &#8211; Mk21"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3220-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #ESP32 #Bluetooth #ThumbJoystick #Keyboard #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01a.png\" alt=\"Bluetooth\" width=\"720\" height=\"482\" class=\"alignnone size-full wp-image-3222\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01a-300x201.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\/2022\/10\/DL2210Mk01b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01b.png\" alt=\"Bluetooth\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3223\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01b-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\/2022\/10\/DL2210Mk01c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01c.png\" alt=\"Bluetooth\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3224\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/10\/DL2210Mk01c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Bluetooth<\/strong><\/p>\n<p>Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks. It employs UHF radio waves in the ISM bands, from 2.402 GHz to 2.48 GHz. It is mainly used as an alternative to wire connections, to exchange files between nearby portable devices, computer and connect cell phones and music players with wireless headphones. In the most widely used mode, transmission power is limited to 2.5 milliwatts, giving it a very short range of up to 10 metres.<\/p>\n<p><strong>DL2210Mk01<\/strong><\/p>\n<p>1 x Adafruit HUZZAH32 \u2013 ESP32 Feather<br \/>\n1 x Lithium Ion Battery &#8211; 2500mAh<br \/>\n1 x Thumb Joystick<br \/>\n1 x SparkFun Thumb Joystick Breakout<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>ESP32 Feather<\/strong><\/p>\n<p>JY0 &#8211; Analog A0<br \/>\nJY1 &#8211; Analog A5<br \/>\nSE0 &#8211; Digital 13<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2210Mk01p.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 #16: Sound - Bluetooth - Mk21\r\n16-21\r\nDL2210Mk01p.ino\r\n1 x Adafruit HUZZAH32 \u2013 ESP32 Feather\r\n1 x Lithium Ion Battery - 2500mAh\r\n1 x Thumb Joystick\r\n1 x SparkFun Thumb Joystick Breakout\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ ESP32 BLE Keyboard\r\n#include &lt;BleKeyboard.h&gt;\r\n\r\n\/\/ ESP32 BLE Keyboard\r\nBleKeyboard bleKeyboard;\r\n\r\n\/\/ Connections to joystick\r\n\/\/ Vertical\r\nconst int VERT = A0;\r\n\/\/ Horizontal\r\nconst int HORIZ = A5;\r\n\/\/ Pushbutton\r\nconst int SEL = 13;\r\n\/\/ Initialize variables for analog and digital values\r\nint vertical;\r\nint horizontal;\r\nint selec;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;16-21&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ ESP32 BLE Keyboard\r\n  if(bleKeyboard.isConnected()) {\r\n\r\n    \/\/ Thumb Joystick\r\n    isThumbJoystick();\r\n\r\n  }\r\n\r\n  \/\/ Delay\r\n  delay( 1000 );\r\n  \r\n}\r\n<\/pre>\n<p><strong>getThumbJoystick.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Thumb Joystick\r\nvoid isThumbJoystick() {\r\n\r\n  \/\/ Read all values from the joystick\r\n  \/\/ Joystick was sitting around 2047 for the vertical and horizontal values\r\n  \/\/ Will be 0-4095\r\n  \/\/ Vertical\r\n  vertical = analogRead(VERT);\r\n  if (vertical == 4095) {\r\n\r\n    \/\/ Volume Up\r\n    bleKeyboard.write(KEY_MEDIA_VOLUME_UP);\r\n    \r\n  } else if (vertical == 0) {\r\n\r\n    \/\/ Volume Down\r\n    bleKeyboard.write(KEY_MEDIA_VOLUME_DOWN);\r\n    \r\n  }\r\n  \/\/ Horizontal\r\n  \/\/ Will be 0-4095\r\n  horizontal = analogRead(HORIZ);\r\n  if (horizontal == 4095) {\r\n\r\n    \/\/ Previous Track\r\n    bleKeyboard.write(KEY_MEDIA_PREVIOUS_TRACK);\r\n    \r\n  } else if (horizontal == 0) {\r\n\r\n    \/\/ Next Track\r\n    bleKeyboard.write(KEY_MEDIA_NEXT_TRACK);\r\n    \r\n  }\r\n  \/\/ Will be HIGH (1) if not pressed, and LOW (0) if pressed\r\n  selec = digitalRead(SEL);\r\n  if (selec == 0) {\r\n\r\n    \/\/ Play\/Pause media key\r\n    bleKeyboard.write(KEY_MEDIA_PLAY_PAUSE);\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  \/\/ Make the SEL line an input\r\n  pinMode(SEL, INPUT_PULLUP);\r\n\r\n  \/\/ ESP32 BLE Keyboard\r\n  bleKeyboard.begin();\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>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/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>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor and E-Mentor<\/strong><\/p>\n<ul>\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>J. Luc Paquin \u2013 Curriculum Vitae &#8211; 2022 English &#038; Espa\u00f1ol<\/strong><br \/>\nhttps:\/\/www.jlpconsultants.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<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 #ESP32 #Bluetooth #ThumbJoystick #Keyboard #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks. It employs UHF radio waves in the ISM bands, from &#8230; <a title=\"Project #16: Sound &#8211; Bluetooth &#8211; Mk21\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3220\" aria-label=\"Read more about Project #16: Sound &#8211; Bluetooth &#8211; Mk21\">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":[119,47,49,80,59,5,82,10,43],"tags":[86,6,242,102,4,19,83,85,24,9,84,27,120,109,33,34],"class_list":["post-3220","post","type-post","status-publish","format-standard","hentry","category-sound","category-adafruit","category-consultant","category-esp32","category-fritzing","category-microcontrollers","category-program-esp32","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-bluetooth","tag-components","tag-consultant","tag-electronics","tag-esp32","tag-fritzing","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-sound","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3220","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=3220"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3220\/revisions"}],"predecessor-version":[{"id":3840,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3220\/revisions\/3840"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}