{"id":3385,"date":"2023-03-18T06:13:46","date_gmt":"2023-03-18T13:13:46","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3385"},"modified":"2023-03-18T06:13:46","modified_gmt":"2023-03-18T13:13:46","slug":"project-26-radio-frequency-sparkfun-joystick-shield-mk09","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3385","title":{"rendered":"Project #26 &#8211; Radio Frequency &#8211; SparkFun Joystick Shield &#8211; Mk09"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3385-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #SparkFunJoystickShield #SparkFunThingPlusESP32WROOM #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\/03\/DL2302Mk04a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04a.png\" alt=\"SparkFun Joystick Shield\" width=\"720\" height=\"499\" class=\"alignnone size-full wp-image-3387\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04a-300x208.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\/03\/DL2302Mk04b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04b.png\" alt=\"SparkFun Joystick Shield\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3388\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04b-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\/03\/DL2302Mk04c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04c.png\" alt=\"SparkFun Joystick Shield\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3389\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2302Mk04c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>SparkFun Joystick Shield Kit<\/strong><\/p>\n<p>The SparkFun Joystick Shield Kit contains all the parts you need to enable your Arduino with a joystick. The shield sits on top of your Arduino and turns it into a simple controller. Five momentary push buttons and a two-axis thumb joystick gives your Arduino functionality on the level of old Nintendo controllers. Soldering is required, but it&#8217;s relatively easy and requires minimal tools. We even have a step by step guide.<\/p>\n<p>The momentary push buttons are connected to Arduino digital pins 2-6; when pressed they will pull the pin low. Vertical movement of the joystick will produce a proportional analog voltage on analog pin 0, likewise, horizontal movement of the joystick can be tracked on analog pin 1.<\/p>\n<p><strong>DL2302Mk04<\/strong><\/p>\n<p>1 x SparkFun Thing Plus &#8211; ESP32 WROOM<br \/>\n1 x SparkFun Joystick Shield Kit<br \/>\n1 x Lithium Ion Battery &#8211; 1 Ah<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>SparkFun Thing Plus &#8211; ESP32 WROOM<\/strong><\/p>\n<p>DLE_UP &#8211; Digital 16<br \/>\nDLE_DOWN &#8211; Digital 19<br \/>\nDLE_LEFT &#8211; Digital 18<br \/>\nDLE_RIGHT &#8211; Digital 17<br \/>\nDLE_FIRE &#8211; Digital 21<br \/>\nDLE_SPACE &#8211; Digital 5<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2302Mk04p.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 - SparkFun Joystick Shield - Mk09\r\n26-09\r\nDL2301Mk01p.ino\r\n1 x SparkFun Thing Plus - ESP32 WROOM\r\n1 x SparkFun Joystick Shield Kit\r\n1 x Lithium Ion Battery - 1 Ah\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ ESP32 BLE Keyboard - NIMBLE\r\n#define USE_NIMBLE\r\n#include &lt;BleKeyboard.h&gt;\r\n\r\n\/\/ ESP32 BLE Keyboard\r\nBleKeyboard bleKeyboard;\r\n\r\n\/\/ Game Controller Buttons\r\n#define DLE_UP 16\r\n#define DLE_DOWN 19\r\n#define DLE_LEFT 18\r\n#define DLE_RIGHT 17\r\n#define DLE_FIRE 21\r\n#define DLE_SPACE 5\r\n\r\n\/\/ Button\r\nbool keyStates[6] = {false, false, false, false, false, false};\r\nint keyPins[6] = {DLE_UP, DLE_DOWN, DLE_LEFT, DLE_RIGHT, DLE_FIRE, DLE_SPACE};\r\nuint8_t keyCodes[6] = {&#039;w&#039;, &#039;x&#039;, &#039;a&#039;, &#039;d&#039;, &#039;y&#039;, &#039; &#039;};\r\n\r\n\/\/ Connect Notification Sent\r\nbool connectNotificationSent = false;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;26-09&quot;;\r\n\r\nvoid loop() {\r\n  \r\n  \/\/ Bluetooth Serial (ESP32SPP)\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\/\/ isBluetooth\r\nvoid isBluetooth() {\r\n\r\n  \/\/ Counter\r\n  int counter;\r\n  \r\n  \/\/ ESP32 BLE Keyboard\r\n  if(bleKeyboard.isConnected()) {\r\n\r\n    \/\/ Connect Notification Sent\r\n    if (!connectNotificationSent) {\r\n      \r\n      connectNotificationSent = true;\r\n      \r\n    }\r\n\r\n    \/\/ Button\r\n    for(counter = 0; counter &lt; 6; counter ++){\r\n      \r\n      handleButton(counter);\r\n      \r\n    }\r\n\r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>getGames.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Games\r\n\/\/ Set Inputs\r\nvoid setInputs() {\r\n  \r\n  \/\/ Make the button line an input\r\n  pinMode(DLE_UP, INPUT_PULLUP);\r\n  pinMode(DLE_DOWN, INPUT_PULLUP);\r\n  pinMode(DLE_LEFT, INPUT_PULLUP);\r\n  pinMode(DLE_RIGHT, INPUT_PULLUP);\r\n  pinMode(DLE_FIRE, INPUT_PULLUP);\r\n  pinMode(DLE_SPACE, INPUT_PULLUP);\r\n\r\n}\r\n\r\n\/\/ Handle Button\r\nvoid handleButton(int keyIndex){\r\n  \r\n  \/\/ Handle the button press\r\n  if (!digitalRead(keyPins[keyIndex])){\r\n    \r\n    \/\/ Button pressed\r\n    if (!keyStates[keyIndex]){\r\n      \r\n      \/\/ Key not currently pressed\r\n      keyStates[keyIndex] = true;\r\n      bleKeyboard.press(keyCodes[keyIndex]);\r\n      \r\n    }\r\n    \r\n  }\r\n  else {\r\n    \r\n    \/\/ Button not pressed\r\n    if (keyStates[keyIndex]){\r\n      \r\n      \/\/ Key currently pressed\r\n      keyStates[keyIndex] = false;\r\n      bleKeyboard.release(keyCodes[keyIndex]);\r\n      \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  \/\/ Set Inputs\r\n  setInputs();\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>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 #SparkFunJoystickShield #SparkFunThingPlusESP32WROOM #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; SparkFun Joystick Shield Kit The SparkFun Joystick Shield Kit contains all the parts you need to enable your Arduino with a joystick. The shield sits on top of your Arduino and turns it into a simple controller. &#8230; <a title=\"Project #26 &#8211; Radio Frequency &#8211; SparkFun Joystick Shield &#8211; Mk09\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3385\" aria-label=\"Read more about Project #26 &#8211; Radio Frequency &#8211; SparkFun Joystick Shield &#8211; Mk09\">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,38,80,59,5,58,82,10,43],"tags":[6,92,242,102,4,19,83,85,24,9,84,27,264,109,276,33,34],"class_list":["post-3385","post","type-post","status-publish","format-standard","hentry","category-radio-frequency","category-digitalelectronics","category-esp32","category-fritzing","category-microcontrollers","category-arduino-programming","category-program-esp32","category-projects","category-sparkfun","tag-arduino","tag-battery","tag-bluetooth","tag-components","tag-consultant","tag-electronics","tag-esp32","tag-fritzing","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-radio-frequency","tag-sparkfun","tag-sparkfun-joystick-shield","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3385","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=3385"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3385\/revisions"}],"predecessor-version":[{"id":3838,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3385\/revisions\/3838"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}