Skip to content

MSFS2020 Transponder Keypad and Display on 7 Segment Module

Jaime Leon edited this page Jan 3, 2022 · 43 revisions

How to Mimic the FBW A320 ATC Keypad and Display

WORK IN PROGRESS - PLEASE COME BACK LATER

In this tutorial we will configure Mobiflight to mimic the operation of the ATC (Transponder) panel keypad of the FlyByWire A320 mod airplane. Our focus will be only on mimicking the behavior of the keypad and display, using RPN in both input and output configurations.

The A320 ATC Panel

The keypad has 9 keys, 8 numeric (numbers 0 to 7) plus a CLR key. The display shows the four octal digits transponder code. In normal operation, the numeric keys are disabled and the CLR key is pressed once or twice, depending on the action needed. Press CLR once to delete and reenter the last number, or press twice to delete the four digits and reenter the entire code. The led display will show the transponder code in normal operation or each new digit from left to right, when entering a new transponder code. The CLR key can be pressed at any time during entering a new code to delete the last number entered, or press twice to restart the code entry. This is the behavior we intend to reproduce in our external ATC panel keypad and display.

A320 ATC panel

Preparations

We will need to have a

  • Any supported Arduino board (Mega, Pro Micro, Uno, Nano)
  • One MAX7219 eight digit 7-Segment LED display module, and
  • Nine buttons for the keypad
  • Working installation of MSFS2020 and Mobiflight

We assume that you know how to wire the 7-segment display module and buttons to your Arduino board. If not, please pause this tutorial and refer to more basic tutorials already available on how to wire and configure devices with Arduino and Mobiflight.

KEY 1 (L:XPNDR_clr) 0 > if{ 1 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_1) }

KEY 2 (L:XPNDR_clr) 0 > if{ 2 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_2) }

KEY 3 (L:XPNDR_clr) 0 > if{ 3 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_3) }

KEY 4 (L:XPNDR_clr) 0 > if{ 4 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_4) }

KEY 5 (L:XPNDR_clr) 0 > if{ 5 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_5) }

KEY 6 (L:XPNDR_clr) 0 > if{ 6 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_6) }

KEY 7 (L:XPNDR_clr) 0 > if{ 7 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_7) }

KEY 0 (L:XPNDR_clr) 0 > if{ 0 (>L:XPNDR_key) 1 (>L:XPNDR_act,bool) (>H:A320_Neo_ATC_BTN_0) }

KEY CLR (L:XPNDR_clr) s1 2 < if{ (L:XPNDR_pos) -- s0 0 < if{ 3 } els{ l0 } (>L:XPNDR_pos) l1 0 == if{ (A:TRANSPONDER CODE:1,number) } els{ (L:XPNDR_temp) } 10 div (>L:XPNDR_temp) 2 (>L:XPNDR_clr) } els{ 0 (>L:XPNDR_temp) 0 (>L:XPNDR_pos) } (>H:A320_Neo_ATC_BTN_CLR) (E:SIMULATION TIME,second) 7 + (>L:XPNDR_timeout)

OUTPUT CONFIG 1 - NUM KEY PRESS HANDLER - 7 SEGMENT DISPLAYS THE CODE WHILE EDITING (SPACE NO PAD) (L:XPNDR_act,bool) if{ 0 (>L:XPNDR_act) (L:XPNDR_clr) 2 == if{ 1 (>L:XPNDR_clr) } (L:XPNDR_key) (L:XPNDR_temp,number) 10 * + (>L:XPNDR_temp,number) (L:XPNDR_pos) ++ 4 min s0 (>L:XPNDR_pos) l0 4 == if{ (L:XPNDR_temp,bco16) (>K:XPNDR_SET) 0 (>L:XPNDR_timeout) 0 (>L:XPNDR_temp,number) 0 (>L:XPNDR_pos) 0 (>L:XPNDR_clr) } (E:SIMULATION TIME,second) 7 + (>L:XPNDR_timeout) } (L:XPNDR_clr) 0 > if{ (L:XPNDR_temp) } els{ (A:TRANSPONDER CODE:1,enum) }

OUTPUT CONFIG 2 - 7 SEGMENT DISPLAYS THE TRANSPONDER CODE (ZERO LEFT PAD)

OUTPUT CONFIG 2 - 7 SEC TIMEOUT HANDLER (L:XPNDR_timeout) 0 != if{ (E:SIMULATION TIME,second) (L:XPNDR_timeout) > if{ 0 s0 (>L:XPNDR_timeout) l0 (>L:XPNDR_temp) l0 (>L:XPNDR_pos) l0 (>L:XPNDR_clr) } }

Installation

User Interface

Examples and tutorials

MSFS2020

X-Plane

Workshops

Community Boards & Devices

Additional Information

Firmware

Clone this wiki locally