{"id":573,"date":"2026-10-11T19:37:24","date_gmt":"2026-10-11T19:37:24","guid":{"rendered":"https:\/\/ndovu.org.uk\/cs\/?p=573"},"modified":"2026-10-11T19:46:04","modified_gmt":"2026-10-11T19:46:04","slug":"stem-racing-1-2-the-trigger-switch","status":"publish","type":"post","link":"https:\/\/ndovu.org.uk\/cs\/stem-racing-1-2-the-trigger-switch\/","title":{"rendered":"STEM racing &#8211; 1.2 The Trigger Switch"},"content":{"rendered":"\n<div class=\"dm-diy-container\">\n    <style>\n        \/* Scoped styles specifically for this guide so it doesn't break WordPress *\/\n        .dm-diy-container {\n            background-color: #121212;\n            color: #e0e0e0;\n            padding: 20px;\n            border-radius: 12px;\n            box-shadow: 0 4px 15px rgba(0,0,0,0.5);\n            font-family: inherit;\n            line-height: 1.6;\n            max-width: 800px;\n            margin: 0 auto;\n        }\n        .dm-diy-container h1 {\n            color: #ff1801;\n            border-bottom: 2px solid #333;\n            padding-bottom: 10px;\n            margin-top: 0;\n            font-size: 1.8em;\n            line-height: 1.2;\n        }\n        .dm-diy-container h2 {\n            margin-top: 40px;\n            color: #ffcc00;\n            font-size: 1.4em;\n        }\n        .dm-diy-container h3 {\n            color: #ffffff;\n        }\n        .dm-diy-container a {\n            color: #00aaff;\n            text-decoration: none;\n        }\n        .dm-diy-container a:hover {\n            text-decoration: underline;\n        }\n        \n        \/* Responsive Table Fix *\/\n        .dm-diy-table-wrapper {\n            overflow-x: auto;\n            margin: 20px 0;\n            border: 1px solid #333;\n            border-radius: 8px;\n        }\n        .dm-diy-container table {\n            width: 100%;\n            min-width: 500px; \/* Forces table to allow scrolling on tiny screens *\/\n            border-collapse: collapse;\n            color: #e0e0e0;\n            margin: 0;\n        }\n        .dm-diy-container th, .dm-diy-container td {\n            text-align: left;\n            padding: 12px;\n            border-bottom: 1px solid #333;\n        }\n        .dm-diy-container th {\n            background-color: #2a2a2a;\n            color: #ffffff;\n        }\n\n        \/* Code Block Fixes (Overrides WordPress theme defaults) *\/\n        .dm-diy-container pre {\n            background-color: #0d0d0d !important;\n            padding: 15px !important;\n            border-radius: 8px !important;\n            overflow-x: auto !important;\n            border: 1px solid #333 !important;\n            margin: 15px 0 !important;\n        }\n        .dm-diy-container code {\n            font-family: \"Courier New\", Courier, monospace !important;\n            color: #00ffcc !important;\n            background: transparent !important; \/* Removes WP theme white highlighting *\/\n            padding: 0 !important;\n            border: none !important;\n            white-space: pre !important; \/* Stops awkward line breaking *\/\n            font-size: 14px !important;\n            line-height: 1.5 !important;\n            display: inline !important;\n        }\n\n        \/* Miscellaneous *\/\n        .dm-diy-container .note {\n            background: #2a2a2a;\n            border-left: 4px solid #ffcc00;\n            padding: 15px;\n            margin: 20px 0;\n            border-radius: 0 4px 4px 0;\n        }\n        .dm-diy-container ul, .dm-diy-container ol {\n            padding-left: 20px;\n        }\n        .dm-diy-container li {\n            margin-bottom: 8px;\n        }\n    <\/style>\n\n    <h1>Build Your Own USB-C Launch Pendant<\/h1>\n    <p>This guide provides step-by-step instructions for building a custom, ultra-low latency USB-C trigger for the Dyson-Mills F1 Launch Simulator. This is an excellent STEM project that introduces students to basic soldering, microcontrollers, and HID (Human Interface Device) programming.<\/p>\n\n    <h2>1. Parts &#038; Suppliers (France \/ Luxembourg)<\/h2>\n    <p>You can source all necessary components from dedicated maker and arcade shops in France.<\/p>\n    \n    <div class=\"dm-diy-table-wrapper\">\n        <table>\n            <thead>\n                <tr>\n                    <th>Component<\/th>\n                    <th>Description<\/th>\n                    <th>Recommended Suppliers<\/th>\n                <\/tr>\n            <\/thead>\n            <tbody>\n                <tr>\n                    <td><strong>Microcontroller<\/strong><\/td>\n                    <td>Seeed Studio XIAO RP2040 or XIAO SAMD21. Tiny, inexpensive, and features native USB-C.<\/td>\n                    <td><a href=\"https:\/\/www.gotronic.fr\" target=\"_blank\">Gotronic.fr<\/a>, <a href=\"https:\/\/www.kubii.fr\" target=\"_blank\">Kubii.fr<\/a><\/td>\n                <\/tr>\n                <tr>\n                    <td><strong>Push Button<\/strong><\/td>\n                    <td>16mm or 24mm Arcade Button (e.g., Sanwa) or a standard momentary push button.<\/td>\n                    <td><a href=\"https:\/\/www.smallcab.net\" target=\"_blank\">SmallCab.net<\/a>, <a href=\"https:\/\/www.gotronic.fr\" target=\"_blank\">Gotronic.fr<\/a><\/td>\n                <\/tr>\n                <tr>\n                    <td><strong>Enclosure<\/strong><\/td>\n                    <td>A 3D-printed handle, a small plastic project box (bo\u00eetier), or a cut piece of PVC pipe.<\/td>\n                    <td>School 3D Printer or Hardware Store<\/td>\n                <\/tr>\n                <tr>\n                    <td><strong>Wiring &#038; Cable<\/strong><\/td>\n                    <td>2x short jumper wires and 1x USB-C to USB-C (or USB-A) data cable.<\/td>\n                    <td>Any electronics retailer<\/td>\n                <\/tr>\n            <\/tbody>\n        <\/table>\n    <\/div>\n\n    <h2>2. Hardware Assembly<\/h2>\n    <ol>\n        <li><strong>Prepare the Enclosure:<\/strong> Drill a hole in the top of your casing perfectly sized for your push button (usually 16mm or 24mm). Drill a smaller hole at the bottom for the USB-C cable to exit.<\/li>\n        <li><strong>Mount the Button:<\/strong> Insert the arcade button into the top hole and secure it with the provided plastic nut.<\/li>\n        <li><strong>Wiring the Circuit:<\/strong>\n            <ul>\n                <li>Strip the ends of your two jumper wires.<\/li>\n                <li>Solder one wire from one terminal of the button to the <strong>GND (Ground)<\/strong> pin on the XIAO microcontroller.<\/li>\n                <li>Solder the second wire from the other terminal of the button to <strong>Pin D0<\/strong> on the XIAO microcontroller.<\/li>\n            <\/ul>\n        <\/li>\n        <li><strong>Final Assembly:<\/strong> Plug the USB-C cable into the microcontroller. Route the cable out the bottom of the enclosure and seal the unit.<\/li>\n    <\/ol>\n\n    <div class=\"note\">\n        <strong>Pro Tip:<\/strong> Ensure you are using a USB-C <em>data<\/em> cable, not just a charging cable. The computer needs data lines to recognize the device as a keyboard.\n    <\/div>\n\n    <h2>3. Programming the Microcontroller<\/h2>\n    <p>We need to tell the microcontroller to act like a standard computer keyboard and press the &#8220;Spacebar&#8221; whenever the button is pushed.<\/p>\n    \n    <ol>\n        <li>Download and install the free <a href=\"https:\/\/www.arduino.cc\/en\/software\" target=\"_blank\">Arduino IDE<\/a>.<\/li>\n        <li>In the Arduino IDE, go to <strong>Tools > Board > Boards Manager<\/strong> and install the &#8220;Seeed SAMD Boards&#8221; or &#8220;Raspberry Pi Pico\/RP2040&#8221; package, depending on which XIAO you bought.<\/li>\n        <li>Plug your assembled pendant into your computer via USB. Select its COM port in <strong>Tools > Port<\/strong>.<\/li>\n        <li>Copy and paste the following code into the Arduino editor:<\/li>\n    <\/ol>\n\n<pre><code>#include &lt;Keyboard.h&gt;\n\nconst int buttonPin = 0; \/\/ Connect button to Pin D0\nint buttonState = HIGH;      \nint previousButtonState = HIGH; \n\nvoid setup() {\n  \/\/ Set the pin as input with an internal pull-up resistor.\n  \/\/ This means the pin reads HIGH when unpressed, and LOW when pressed to Ground.\n  pinMode(buttonPin, INPUT_PULLUP);\n  \n  \/\/ Initialize the keyboard emulation\n  Keyboard.begin();\n}\n\nvoid loop() {\n  buttonState = digitalRead(buttonPin);\n  \n  \/\/ Check if the button was just pressed (transition from HIGH to LOW)\n  if (buttonState == LOW && previousButtonState == HIGH) {\n    Keyboard.press(' '); \/\/ Send the Spacebar keystroke\n    delay(10);           \/\/ Hardware debounce delay\n  }\n  \n  \/\/ Check if the button was just released (transition from LOW to HIGH)\n  if (buttonState == HIGH && previousButtonState == LOW) {\n    Keyboard.releaseAll(); \/\/ Release the key\n    delay(10);\n  }\n  \n  previousButtonState = buttonState;\n}<\/code><\/pre>\n\n    <ol start=\"5\">\n        <li>Click the <strong>Upload<\/strong> button (the right arrow icon). Once it says &#8220;Done uploading&#8221;, your pendant is ready!<\/li>\n    <\/ol>\n\n    <h2>4. Testing on the Simulator<\/h2>\n    <p>Open the Dyson-Mills Racing Simulator. Do not click the screen\u2014simply hold your new pendant and press the button. The game will immediately register the &#8220;Spacebar&#8221; input and stop the timer, giving you physical hardware speeds in a web environment.<\/p>\n\n    <div style=\"margin-top: 40px; text-align: center;\">\n        <a href=\"https:\/\/ndovu.org.uk\/racing\/\" style=\"font-weight: bold; padding: 10px 20px; border: 2px solid #00aaff; border-radius: 6px; display: inline-block;\">\u2190 Back to Racing Simulator<\/a>\n    <\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build Your Own USB-C Launch Pendant This guide provides step-by-step instructions for building a custom, ultra-low latency USB-C trigger for the Dyson-Mills F1 Launch Simulator.&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/ndovu.org.uk\/cs\/stem-racing-1-2-the-trigger-switch\/\">Continue Reading<span class=\"screen-reader-text\">STEM racing &#8211; 1.2 The Trigger Switch<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-573","post","type-post","status-publish","format-standard","hentry","category-stem","entry"],"_links":{"self":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/comments?post=573"}],"version-history":[{"count":3,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/573\/revisions"}],"predecessor-version":[{"id":577,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/573\/revisions\/577"}],"wp:attachment":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/media?parent=573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/categories?post=573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/tags?post=573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}