{"id":3398,"date":"2023-04-01T05:51:24","date_gmt":"2023-04-01T12:51:24","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3398"},"modified":"2023-04-01T05:51:24","modified_gmt":"2023-04-01T12:51:24","slug":"project-26-radio-frequency-joystick-mk11","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3398","title":{"rendered":"Project #26 &#8211; Radio Frequency &#8211; Joystick &#8211; Mk11"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3398-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Joystick #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\/04\/DL2303Mk02a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02a.png\" alt=\"Joystick\" width=\"720\" height=\"560\" class=\"alignnone size-full wp-image-3400\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02a-300x233.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\/04\/DL2303Mk02b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02b.png\" alt=\"Joystick\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3401\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02b-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\/04\/DL2303Mk02c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02c.png\" alt=\"Joystick\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3402\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/04\/DL2303Mk02c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Thumb Joystick<\/strong><\/p>\n<p>This is a joystick very similar to the &#8220;Analog&#8221; joysticks on PS2 controllers. Directional movements are simply two potentiometers, one for each axis. Pots are ~10k each. This joystick also has a select button that is actuated when the joystick is pressed down. This is the breakout board for the thumb joystick SparkFun Thumb Joystick Breakout.<\/p>\n<p><strong>DL2303Mk02<\/strong><\/p>\n<p>1 x SparkFun Thing Plus &#8211; ESP32 WROOM<br \/>\n1 x SparkFun Joystick Shield Kit<br \/>\n1 x Thumb Joystick<br \/>\n1 x SparkFun Thumb Joystick Breakout<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 12<br \/>\nDLE_SPACE &#8211; Digital 5<br \/>\nDLE_SPACEA &#8211; Digital 21<br \/>\nLED &#8211; LED_BUILTIN<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2303Mk02p.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 - Joystick - Mk11\r\n26-11\r\nDL2303Mk02p.ino\r\n1 x SparkFun Thing Plus - ESP32 WROOM\r\n1 x SparkFun Joystick Shield Kit\r\n1 x Thumb Joystick\r\n1 x SparkFun Thumb Joystick Breakout\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 12\r\n#define DLE_SPACE 5\r\n#define DLE_SPACEA 21\r\n\r\n\/\/ Button\r\nbool keyStates[7] = {false, false, false, false, false, false, false};\r\nint keyPins[7] = {DLE_UP, DLE_DOWN, DLE_LEFT, DLE_RIGHT, DLE_SPACEA, DLE_SPACE, DLE_FIRE};\r\nuint8_t keyCodes[7] = {KEY_UP_ARROW, KEY_DOWN_ARROW, KEY_LEFT_ARROW, KEY_RIGHT_ARROW, &#039; &#039;, &#039; &#039;, KEY_LEFT_CTRL};\r\n\r\n\/\/ Connect Notification Sent\r\nbool connectNotificationSent = false;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;26-11&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; 7; 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  pinMode(DLE_SPACEA, INPUT_PULLUP);\r\n  \/\/ Initialize digital pin LED_BUILTIN as an output.\r\n  pinMode(LED_BUILTIN, OUTPUT);\r\n  \/\/ Turn the LED on HIGH \r\n  digitalWrite(LED_BUILTIN, HIGH);\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  } 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 #Joystick #SparkFunJoystickShield #SparkFunThingPlusESP32WROOM #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Thumb Joystick This is a joystick very similar to the &#8220;Analog&#8221; joysticks on PS2 controllers. Directional movements are simply two potentiometers, one for each axis. Pots are ~10k each. This joystick also has a select button &#8230; <a title=\"Project #26 &#8211; Radio Frequency &#8211; Joystick &#8211; Mk11\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3398\" aria-label=\"Read more about Project #26 &#8211; Radio Frequency &#8211; Joystick &#8211; Mk11\">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,49,38,80,59,5,82,10,43],"tags":[6,92,102,4,19,83,85,278,24,9,84,27,264,109,33,34],"class_list":["post-3398","post","type-post","status-publish","format-standard","hentry","category-radio-frequency","category-consultant","category-digitalelectronics","category-esp32","category-fritzing","category-microcontrollers","category-program-esp32","category-projects","category-sparkfun","tag-arduino","tag-battery","tag-components","tag-consultant","tag-electronics","tag-esp32","tag-fritzing","tag-joystick","tag-microcontroller","tag-programming","tag-programming-esp32","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\/3398","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=3398"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3398\/revisions"}],"predecessor-version":[{"id":3403,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3398\/revisions\/3403"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}