Skip to content

Instantly share code, notes, and snippets.

@amyinorbit
Last active April 16, 2025 13:42
Show Gist options
  • Save amyinorbit/c49582a4921cf807f2ecabaf1915e75f to your computer and use it in GitHub Desktop.
Save amyinorbit/c49582a4921cf807f2ecabaf1915e75f to your computer and use it in GitHub Desktop.
Mobiflight config and command reverse-engineering

Mobiflight config and command reverse-engineering

Config Types:

0   NotSet
1   Button
2   Encoder (single detent)
3   Output
4   Led Module (deprecated)
5   Stepper (deprecated, v1)
6   Servo
7   LCD Display
8   Encoder
9   Stepper (deprecated, v2)
10  Shift Register
11  Analog Input
12  Input Shift Register
13  Multiplexer Driver (not proper device, used for events)
14  Input Multiplexer
15  Stepper
16  LED Module
17  Custom Device

Format:

<TYPE>('.'<PARAM>)*':'
<TYPE> = [0-17]
<PARAM> = [0-9]+ | <STRING>

Config syntax

Button      1.<PIN>.<NAME>:
Output      3.<PIN>.<NAME>:
Encoder     8.<LEFT PIN>.<RIGHT PIN>.<ENCODER TYPE (1?)>.<NAME>:
Shift Reg   10.<LATCH PIN>.<CLOCK PIN>.<DATA PIN>.<NUM MODULES>.<NAME>:
Analog In   11.<PIN>.<SENSITIVITY>.<NAME>:
Mux         14.<PIN 1>.<PIN 2>.<PIN 3>.<PIN 4>.<NAME>:

Set Command Syntax

Output:     Setpin      2,<pin>,<value>

// This is odd because module is just 0-based index in the daisy chain of
// shift registers, but that means there is no way to address multiple chains.
// My hunch is that MF only supports one chain of shift registers in a device,
// and that's it.
//
// The Pins string is sent as a pipe-separated list of pins
Shift Reg:  SetRegPin   27,<module>,<pins/str>,<value/int>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment