กลับไปหน้ารวมไฟล์
switchled-panel-with-arduino-for-fs2020-36530e.md

If you are a Flight Simulator enthusiast and would try to build your first external panel to send some commands and read some status from FS, probably you will be interested in this project because it's simple, flexible and cheap.

This project will let you play with some Arduino programming code but don't need any development effort on the PC side. On the other end you will play also with some very simple hardware stuff other then an Arduino board of any type (i used a Nano). The most important thing, however, is that with a very little effort, thepanel can be highly customized to your needs by changing the function of each button/switch/LED or adding new ones.

For the whole project visit: https://github.com/IWILZ/FS2020-Switch-Panel

You can see a short video here:

What it does

The panel manages and shows the state of:

  • flaps incrementing/decrementing them to max 4 positions
  • navigation lights (grouped in STROBE, NAV, BEACON, WING, LOGO, CABIN and PANEL)
  • landing lights (grouped in LANDING and TAXI)
  • pitot heat
  • rudder trim
  • engine(s) startup and shutdown with AUTO_START and AUTO_SHUTDOWN functions of simulator
  • in addition I have also a RESET button that is useful when starting the flight to be sure about the state of all the lights of the plane

🛠️ เจาะลึกเบื้องหลังการทำงาน (Deep Dive / Technical Analysis)

Pushing a keyboard button to toggle Landing Gear in the wildly realistic Microsoft Flight Simulator 2020 (FS2020) completely shatters system immersion. The Switch/LED Panel project commands the programmer to entirely abandon standard "Uno" Serial architecture! By utilizing the explicit native USB-HID (Human Interface Device) capabilities of an Arduino Pro Micro (ATmega32U4), you completely build a massive, physical aerospace panel consisting of 20 metal toggle-switches—and Windows literally instantly detects your breadboard as an authentic $300 commercial "USB Gaming Joystick" without drivers!

The Native Joystick HID Architecture (Joystick.h)

This absolutely CANNOT work smoothly on an Arduino Uno. The Uno uses a generic CH340 or 16u2 USB chip that only speaks basic string text Serial.print("Hello").

  1. The Arduino Pro Micro has intrinsic, raw USB hardware capabilities natively.
  2. The incredibly powerful <Joystick.h> massive library explicitly formats the massive 32-bit USB descriptor payloads natively!
  3. The Initialization Array:
// You define you are creating an explicit Gamepad Controller with NO joysticks, just 32 raw buttons!
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_GAMEPAD, 
  32, 0, false, false, false, false, false, false, false, false, false, false, false);

Multi-Switch Debouncing Grid Processing

FS2020 expects a single button "Pulse" to toggle the Landing Gear, but a giant SPST Toggle Switch physically locks HIGH indefinitely.

  • You must write massive C++ state-tracking mapping logic to fake pulses!
  • If the switch is physically pushed UP (State = HIGH):
if (currentSwitchState != lastSwitchState) { // The metal toggle literally flipped!
  Joystick.setButton(0, 1); // Blast Button #0 PRESSED into Windows natively!
  delay(50); // Hold it!
  Joystick.setButton(0, 0); // RELEASE the button so FS2020 registers the pulse!
  lastSwitchState = currentSwitchState; // Secure the array!
}
  • A massive for loop sweeps through exactly 16 inputs natively, seamlessly interpreting large rows of complex physical toggles and rotary dials directly into Microsoft Flight Simulator completely transparently.

Aerospace Simulation Needs

  • Arduino Pro Micro or Leonardo (Absolutely mandatory! It MUST have the ATmega32U4 chip. An Uno or Mega relies exclusively upon generic third-party software like Mobiflight to bypass limits, but the Pro Micro does it beautifully purely natively in hardware!).
  • Large Array of Physical Hardware (Heavy duty metal toggle SPST switches, massive red/green 10mm status LEDs, rotary encoders).
  • Windows PC running FS2020, X-Plane 11, or DCS World (The native Windows USB environment absorbs the logic array immediately).

ข้อมูล Frontmatter ดั้งเดิม

title: "Switch/LED Panel with Arduino for FS2020"
description: "A simple panel to add some commands and status LEDs for Microsoft Flight Simulator 2020 on a PC"
author: "iwilz"
category: "Gadgets, Games & Toys"
tags:
  - "fs2020"
  - "communication"
  - "games"
views: 14963
likes: 6
price: 699
difficulty: "Intermediate"
components:
  - "7x LED (generic)"
  - "9x Switch Actuator, Head for spring return push-button"
  - "1x Arduino Nano 33 IoT"
  - "1x Soldering iron (generic)"
tools: []
apps:
  - "1x Arduino IDE"
  - "1x FS2020TA"
downloadableFiles:
  - "https://github.com/IWILZ/FS2020-Switch-Panel"
documentationLinks: []
passwordHash: "92aafe435bdce8b005406bee7d7036c0b71792043a06a4cd7b86e3a1a6cdf693"
encryptedPayload: "U2FsdGVkX19xCdCVnmPjDOYzRh6EIYroimBuEIjUyaUBSRg7TubTTLfOvAQh4dnrIsp7StP94SUqzkozyq+eSdYphsxPn9x/w84DKOuc9cjHWqGg0UvQ+xnTJajacHHd"
seoDescription: "Build a Switch/LED Panel for Microsoft Flight Simulator 2020 using Arduino. Add custom commands and status LEDs to your PC setup."
videoLinks:
  - "https://www.youtube.com/embed/05aUgwHtf3Q"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/switchled-panel-with-arduino-for-fs2020-36530e_cover.jpg"
lang: "en"