Skip to content

Arduino Nano based hub that connects your digital and analog console switching setup with the RetroTink 4K and/or RetroTink 5x/OSSC for Auto Profile switching

License

Notifications You must be signed in to change notification settings

svirant/DonutDongle

Repository files navigation

Donut Dongle

Arduino Nano based hub that connects your digital and analog console switching setup with the RetroTink 4K and/or RetroTink 5x / OSSC for Auto Profile switching

The Donut Dongle connects to a switch in a way that allows it to see which port is active. When a console powers on (auto-switching) or an input is manually selected, the Donut Dongle sends a serial command to the RetroTink 4k (or IR signal to the RT5x, OSSC) telling it to load a profile. For the RT4K, the profiles can either be defined as remote profiles; those configured in the menu for the remote buttons. Or they can be SVS profiles which are configured on the RT4K's SDcard.

For details, refer to the "How to Use" section below.

Tip

If DIY is not your thing. I have assembled versions for gScart/gComp and MT-VIKI/TESmart/Extron/db9 available in my Ko-fi shop.


Note

NEW beta allows:

  • MT-VIKI Disconnection Detection - when an input is powered off and on, the profile is resent.
  • front case buttons/remote NOW change profiles on the MT-VIKI HDMI switch. Thanks to Arthrimus!
  • auto-switching on Extron Matrix switchers that support DSVP. Works with RGBS/HV and HDMI/DVI signal types.
  • Support for older Extron Crosspoint (non plus) matrix switchers


Use the follow Options to enable:

bool automatrixSW1 = true; // set true for auto matrix switching on "SW1" port
bool automatrixSW2 = false; // set true for auto matrix switching on "SW2" port

int amSizeSW1 = 8; // number of input ports for auto matrix switching on SW1. Ex: 8,12,16,32
int amSizeSW2 = 8; // number of input ports for auto matrix switching on SW2. ...

uint8_t ExtronVideoOutputPortSW1 = 1; // For non "Plus" Extron Matrix models, must specify video output port that connects to RT4K
uint8_t ExtronVideoOutputPortSW2 = 1;

uint8_t const vinMatrix[33] = {0,  // MATRIX switchers  // When auto matrix mode is enabled: (automatrixSW1 / SW2 above)
                                                      // set to 1 for the auto switched input to trigger a Preset on SW1
                                                      // set to 2 for the auto switched input to trigger a Preset on SW2
                                                      // set to 3 for both SW1 & SW2
                                                      // set to 0 to disable this feature (default - aka input goes to all outputs unless defined in voutMatrix)
                                                      //
                                                      // set the following inputs to the desired Preset #
                                                      // (by default each input # is set to the same corresponding Preset #)
                                                      
uint8_t const voutMatrix[34] = {1,  // MATRIX switchers // When auto matrix mode is enabled: (automatrixSW1 / SW2 above)
                                                      // set to 1 for the auto switched input to go to ALL outputs (default)
                                                      // set to 0 to select outputs to be enabled/disabled as listed below
                                                      //
                                                      // When auto matrix mode is disabled: 
                                                      // ALL input changes to any/all outputs result in a profile change
                                                      // disable specific outputs from triggering profile changes


Thanks to

  • Justin Peacock for the amazing case design
  • HerraAAV3 from the RetroTink discord for the VGA Adapter case design
  • Mike Chi for help with the open drain serial bits
  • @niquallis, @UstSte, and last but not least Aru for beta testing

Supported Switches

(current list, but not limited to)

Switch Supported Notes
MT-VIKI 8 port HDMI yes, confirmed first hand. RT4K remote can also change inputs and profiles. Front case buttons and included IR remote NOW also change profiles! All Thanks to Arthrimus! Only supported in _beta firmware atm.
TESmart 16x1 HDMI yes, confirmed first hand RT4K remote can also change inputs and profiles.
TESmart 8x1 HDMI unconfirmed, but should work, let me know!
gSCARTsw / gCOMPsw version 5.x confirmed by @niquallis and @UstSte, thanks so much for your help! Manual input selection works too!
Extron RGBHV sw6 yes, confirmed first hand
Extron DXP 88 yes, confirmed first hand at the moment, works with Presets only. Preset 1 is Profile/SVS 1. On Extron sw2 port Preset 1 is SVS 101, etc
Extron CrossPoint, MVX, etc same as DXP 88 above. at the moment, Presets only
Extron CrossPoint E-series yes, works with Presets and Input changes Must set ExtronVideoOutputPortSW1 / SW2 variable to output connected to RT4K
Extron SW4 VGA Ars yes, confirmed by "Nobody" on the RT4K Discord
Otaku Games Scart 10 Jumper moved to "L" and with required mod , SVS=0; must also be set in the Otaku .ino for the DD to respond modded switch works on its own, but connecting through the DD is mostly useful if your Otaku mod doesn't include the buffer IC

Connections

  • Connect 4 switches Total
    • 2x gscart/gcomp
    • 2x Extron, 2x TESmart, or 1 of each
  • 1x usb-c port for power/programming (on Arduino Nano)
  • 1x 3.5mm "TX OUT to Retrotink 4K VGA adapter" port
  • 1x IR Emitter (required for OSSC, RT5x (RT5x must be on firmware version 3.7 or higher))
  • 1x IR Receiver (optional for better reception and IR remote customizations)



Layout Example

  • TESmart 16x1 HDMI switch & 2x gSCART/gCOMP
    • VGA Passthrough adapter
    • TESmart adapter
    • gScart EXT pushpin adapter



  • Case closed
    • ribbon cables fold over and come out slots in the back of case



Connection Acccessories

gscart/gcomp EXT connector (plug-n-play)
The spring pins allow it to stay "sandwiched" in place by the lid

TESmart connector

MT-VIKI / Extron / DB9 adapter

Parts listed in BOM below

Alternate Extron connection type:

  • DB9 male to 3.5mm (connects to alt sw1 / alt sw2 port instead of 2x5 header)
  • Higher quality and much longer cord than the standard 2x5 cable

DB9_to_TRS_wiring


New IR Remote Control functionality

When using the optional IR Receiver, the IR reception of the RT4K can be been greatly enhanced. You can think of it as an IR repeater, but instead talks to the RT4K via Serial for solid communication. Since the Donut Dongle is in the middle, other remote features can be added such as:

  • Normally, if you power on your console before waking the RT4K, the RT4K will have not seen the profile change. Using the remote's POWER button, in this configuration, will wake the RT4K "and" resend the profile after it's finished waking.

  • AUX8 button + Power button power cycles your TV via IR Emitter. (only LG OLED CX atm, more can be added upon request)

  • AUX8 button + profile button 1 - 12 loads SVS profiles of your choosing. By default is SVS 1 - 12

  • AUX8 pressed twice, manually enter a SVS profile to load with the profile buttons using 1 - 9 and 10,11,12 buttons for 0. Must use 3 digits. Ex: 001 = 1, 010 = 10, etc

  • MT-ViKI 8 Port HDMI switch's inputs can be changed with AUX8 button + profile buttons 1 - 8. Must configure "MTVIKIir" in the options section of the .ino

  • TESmart 16x1 HDMI switch's inputs can changed. Must set "TESmartir" in the options section.

    • AUX7 + button 1 - 12, aux1, aux2, aux3, aux4 for inputs 1 - 16 on "alt sw1" port (SVS profiles 1 - 16)
    • AUX8 + button 1 - 12, aux1,aux2,aux3,aux4 for inputs 1 - 16 on "alt sw2" port (SVS profiles 101 - 116)

gScart / gComp Control (must set gctl = 1 in Options, Only supported on vers 5.x switches)

  • AUX5 button + profile button 1 - 8 button selects corresponding input on gscart sw1

    • AUX5 button + profile button 9 - 12 button to return to auto switching
  • AUX6 button + profile button 1 - 8 button selects corresponding input on gscart sw2

    • AUX6 button + profile button 9 - 12 button to return to auto switching
  • RT5x and OSSC may require a repeat of the button combos


Let me know what ideas you have, and perhaps I can add them in.

Note: To stop the RT4K from responding twice (once from the built-in IR sensor and once from the Donut Dongle), place the included "ir_remote.txt" on the root of the SDcard. This remaps the builtin IR for every button except POWER to the RT5x remote. This way you can still use the POWER button to power on the RT4K but will stop it from responding from all other button presses.

Ordering PCBs

PCBs for this project:

There are plenty of options for PCB manufacturing but I prefer JLCPCB (No affiliation). Using the gerber (.zip) files provided, it's easy to place an order. Below are some tips/guidelines:

  • 1.0mm PCB Thickness for gscart_ext_connector.zip
  • 1.6mm for all others
  • For Surface Finish, "HASL(with lead)" is fine
  • 4 Layer PCBs are the same cost as 2 Layer for the VGA Adapters. Because of that, the inner 2 layers are being used as ground planes for better EMI protection. Thanks to https://x.com/zaxour for the idea!
  • "Remove Mark" option is now free on JLCPCB. Use it!
  • All remaining default options should be fine
  • Let me know if you have any questions!

Assembly

v1.0

Interactive HTML BOM

PCB

v1.0



Schematic

v1.0



Bill of Materials (BOM)

- 3D Printed VGA Adapter Case [Courtesy of HerraAAV3 on the RetroTink Discord]


  • Donut Dongle PCB
Qty Designation Part Link Notes
2 C1,C5 0.1 uf / 100nf 50V X7R 0805 Capacitor Digikey
3 C2-C4 0.33 uf / 330nf 50V X7R 0805 Capacitor Digikey
1 R1 30 OHM 1% 1/2W 0805 Resistor Digikey
1 R2 1K OHM 1% 1/8W 0805 Resistor Digikey
10 R3 - R10, R17, R19 10K OHM 1% 1/8W 0805 Resistor Digikey
8 R11 - R16, R18, R20 20K OHM 1% 1/8W 0805 Resistor Digikey
1 Q1 2N3904 NPN Transistor AliExpress
1 U1 MAX3232 SOP-16 RS-232 Interface IC AliExpress
1 U2 IC BUF NON-INVERT 5.5V SOT23-6 Digikey or alternate
1 PH1 PJ-307 3.5mm Stereo Jack AliExpress
or 1x 3.5mm Audio Jack Socket AliExpress Like the PJ-307 but missing the inner 2 poles which arent needed anyways
4 J4,J9-11 PJ-320 3.5MM Headphone Jack Audio Video Female AliExpress Color: PJ-320B DIP
2 J3,J6 2x5 Pin Double Row 2.54mm Pitch Straight Box Header AliExpress (Color: STRAIGHT TYPE, Pins: 10PCS DC3-10Pin)
2 J5,J8 2x4 Pin Double Row 2.54mm Pitch Straight Box Header AliExpress (Color: STRAIGHT TYPE, Pins: 10PCS DC3-8Pin)
1 (optional) 3.5mm CHF03 1.5 Meters IR Infrared Remote Emission Cable AliExpress required for OSSC, RT5X (must be firmware version 3.7+)
1 (optional) 3.5mm Infrared Remote Control Receiver Extension Cable AliExpress required for New IR Remote Control functionality
2 H1,H2 2.54mm Pitch Single Row Female 15P Header Strip AliExpress
1 Any 3.5mm / aux / stereo / trs / cable AliExpress
1 usb-c cable for Arduino power & initial programming AliExpress
1 Arduino Nano type c Support RetroRGB! Make sure the headers and esp the 2x3 pins are not soldered.
1 JP2 2x3 Pin Double Row 2.54mm Pitch Header Use the one that comes with the Arduino Nano. Jumper "H" for all switches unless instructed otherwise.
2 JP3,4 1x3 Pin Single Row 2.54 Pitch Header Dont buy two 1x3. Find any single row header and break off two 1x3 sections. Jumper "H" for all switches unless instructed otherwise.
4 2.54mm Jumper AliExpress You can also just solder blob "H". "L" jumper setting has only 1 use case atm.
  • Switch connection Cables
Qty Switch Type Part Link Notes
1 or 2 TESmart HDMI Any 3.5mm / aux / stereo / trs / Cable AliExpress strip 1 end to expose red(Rx)/white(Tx)/gnd wires for the green screw clamp OR use the TESmart_connector shown below
1 or 2 GscartSW/GCompSW 2x4 Pin Double Row 2.54 Pitch Angled Box Header AliExpress (Color: RIGHT ANGLE TYPE, Pins: 10PCS DC3 8Pin), Solders onto EXT port. Or use the gscart_ext_connector shown below.
1 or 2 GscartSW/GCompSW 2x4 Pin Female Header Ribbon Cable AliExpress (Pins: 2x4Pin, Color: Any length)
1 Extron 2 Port DB9 to 2x5 Pin Female Header Ribbon Cable AliExpress
or 2x DB9 Male to 3.5mm Male Serial RS232 Cable 6feet Amazon "MUST" be wired as so: DB9 Male Pin 5 -> Sleeve, DB9 Male Pin 2 -> Tip, DB9 Male Pin 3 -> Ring
or make your own connectors in the "Connection Accessories" section below.

At least 1 of the following VGA adapters is required:

  • YC2VGA w/ Serial Tap v2: (enhanced s-video and composite as a bonus)


Qty Part Link Notes
1 Yellow RCA Composite jack AliExpress (Color: Yellow)
1 S-Video jack AliExpress (Color: A 4Pin)
1 PJ-320 3.5MM Headphone Jack Audio Video Female AliExpress (Color: 10PCS PJ-320)
1 VGA Male Connector [L717HDE15PD4CH4R-ND] Digikey
  • VGA Passthrough w/ Shared Serial Tap:
    • Confirmed compatible with the Scalable Video Switch and it's auto profiles.



Qty Part Link Notes
1 VGA Male Connector [L717HDE15PD4CH4R-ND] Digikey
1 VGA Female Connector AliExpress (Color: DB15 3.08)
1 PJ-320 3.5MM Headphone Jack Audio Video Female AliExpress (Color: 10PCS PJ-320)
2 #4-40 x 3/4" screw (optional) Ebay
  • gscart/gcomp EXT connector
Qty Part Link Notes
1 2x4 Pin Double Row 2.54 Pitch Angled Box Header AliExpress (Color: RIGHT ANGLE TYPE, Pins: 10PCS DC3 8Pin)
6 Pogo-Pin Digikey
  • TESmart connector
Qty Part Link Notes
1 PJ-320 3.5MM Headphone Jack Audio Video Female AliExpress (Color: 10PCS PJ-320)
  • MT-VIKI / Extron / DB9 connector
Qty Part Link Notes
1 PJ-320 3.5MM Headphone Jack Audio Video Female AliExpress (Color: 10PCS PJ-320)
1 DB9 Male connector AliExpress (Color: Male head)
2 #4-40 1/4" pan head screw Amazon

Programming an Arduino Nano

I recommend the Official Arduino IDE and guide if you're unfamiliar with Arduinos. All .ino files used for programming are listed above. The following Libraries will also need to be added in order to Compile successfully.

  • Libraries:
    • <IRremote.hpp> "IRremote" available through the built-in Library Manager under "Tools" -> "Manage Libraries..."
    • <AltSoftSerial.h> Follow these steps to add AltSoftSerial.h

Steps to program the Donut Dongle

  • 1 - Click the green "<> Code" button above and "Download ZIP".
  • 2 - Extract the .zip file and open up the "Donut_Dongle.ino" file in the Arduino IDE. It will ask if you would like to move this file inside a folder, select OK.
  • 3 - With the source code now open, select "Tools" -> "Board" -> "Arduino AVR Boards" -> "Arduino Nano"
  • 4 - Connect the Donut Dongle device to your PC or Mac using the usb-c cable. You should see an LED light up when connected.
  • 5 - With the Donut Dongle now connected, select it's "port" by going to "Tools" -> "Port", and select the port that starts with "/dev/cu.usbserial-" (on Mac) or "COM" if on PC.
  • 6 - From the menu at the top, select "Sketch" -> "Verify/Compile". If everything is setup properly, you should see a message in the bottom corner saying "Done compiling".
  • 7 - Now select "Sketch" -> "Upload". You should see the LEDs on the Donut Dongle flicker and a message that says "Done uploading." if successful.
    • If you get errors, see the section below about changing the "Bootloader" type.
  • 8 - Disconnect the usb-c cable from your computer and give it a whirl! You can repeat these steps in the future to make any other changes or update if a newer firmware is ever released.
  • 9 - It's also best practice when unplugging/reconnecting cables to the Donut Dongle, that you do so with the power disconnected.


How to Use

  • Make sure "Auto Load SVS" is "On" under the RT4K Profiles menu.

  • The RT4K checks the /profile/SVS subfolder for profiles and need to be named: S<input number>_<user defined>.rt4 For example, SVS input 2 would look for a profile that is named S2_SNES.rt4. If there’s more than one profile that fits the pattern, the first match is used.

  • Check the RT4K Diagnostic Console for Serial commands being received as confirmation.


Troubleshooting

  • When (un)plugging aux cables from "alt sw1" or "alt sw2" ports make sure Donut Dongle power is disconnected. Sometimes the onboard MAX3232 chip can lock up if this is not done.

    • To fix lockup, power off switch and DD (Donut Dongle). Disconnect/reconnect aux cable from DD and power up switch first, then DD last.
  • Some Arduino Nanos come with an Old Bootloader and won't Upload unless specified. If you get errors when trying to upload, swap to this option as a possible fix.

bootloader


SVS Profile numbering scheme

SVS = 1 (default) Profile # Notes
Extron sw1 / alt sw1 1 - 99 also for TESmart, MT-ViKi, Otaku Games Scart 10 devices
Extron sw2 / alt sw2 101 - 199 also for TESmart, MT-ViKi, Otaku Games Scart 10 devices
GSCART sw1 201 - 208
GSCART sw2 209 - 216

Remote Button Profiles are not used when SVS=1


SVS = 0 Profile # Notes
Extron sw1 / alt sw1 13 - 99 also for TESmart, MT-ViKi, Otaku Games Scart 10 devices
Extron sw2 / alt sw2 101 - 199 also for TESmart, MT-ViKi, Otaku Games Scart 10 devices
GSCART sw1 201 - 208
GSCART sw2 209 - 216

Remote Button Profiles 1-12 are used for Extron sw1 when SVS=0


SVS = 2 Profile # Notes
Extron sw1 / alt sw1 1 - 99 also for TESmart, MT-ViKi, Otaku Games Scart 10 devices
Extron sw2 / alt sw2 101 - 199 also for TESmart, MT-ViKi, Otaku Games Scart 10 devices
GSCART sw1 N/A
GSCART sw2 213 - 216 inputs 5-8

Remote Button Profiles 1-12 are used for GSCART sw1 inputs 1-8 and GSCART sw2 inputs 1-4 when SVS=2



The following is from the .ino file itself. Refer to it directly for all Advanced Options.

/*
////////////////////
//    OPTIONS    //
//////////////////
*/


uint16_t const offset = 0; // Only needed for multiple Donut Dongles (DD). Set offset so 2nd,3rd,etc boards don't overlap SVS profiles. (e.g. offset = 300;) 
                      // MUST use SVS=1 on additional DDs. If using the IR receiver, recommended to have it only connected to the DD with lowest offset.


uint8_t const SVS = 1; //     "Remote" profiles are profiles that are assigned to buttons 1-12 on the RT4K remote. "SVS" profiles reside under the "/profile/SVS/" directory 
                      //     on the SD card.  This option allows you to choose which ones to call when a console is powered on.  Remote profiles allow you to easily change 
                      //     the profile being used for a console's switch input if your setup is in flux. SVS require you to rename the file itself on the SD card which is 
                      //     a little more work.  Regardless, SVS profiles will need to be used for console switch inputs over 12.
                      //
                      // **** Make sure "Auto Load SVS" is "On" under the RT4K Profiles menu. A requirement for most options ****
                      //
                      // 0 - use "Remote" profiles 1-12 for up to 12 inputs on 1st Extron Switch and SVS 13 - 99 for everything over 12. Only SVS profiles are used on 2nd Extron Switch if connected.
                      //
                      //     - remote profiles 1-12 for 1st Extron or TESmart Switch (If S0 below is set to true - remote profile 12 is used when all ports are in-active)
                      //     - SVS  12 - 99  for 1st Extron or TESmart (S0 is true)
                      //     - SVS  13 - 99  for 1st Extron or TESmart (S0 is false)
                      //     - SVS 101 - 199 for 2nd Extron or TESmart
                      //     - SVS 201 - 208 for 1st gScart
                      //     - SVS 209 - 216 for 2nd gScart
                      //
                      // 1 - use only "SVS" profiles.
                      //     Make sure "Auto Load SVS" is "On" under the RT4K Profiles menu
                      //     RT4K checks the /profile/SVS subfolder for profiles and need to be named: "S<input number>_<user defined>.rt4"
                      //     For example, SVS input 2 would look for a profile that is named S2_SNES.rt4
                      //     If there’s more than one profile that fits the pattern, the first match is used
                      //
                      //     - SVS   1 -  99 for 1st Extron or TESmart
                      //     - SVS 101 - 199 for 2nd Extron or TESmart
                      //     - SVS 201 - 208 for 1st gScart
                      //     - SVS 209 - 216 for 2nd gScart
                      //     - SVS   0       for S0 option mentioned below
                      //
                      //  ** If S0 below is set to true, create "/profile/SVS/S0_<user defined>.rt4" for when all ports are in-active. Ex: S0_HDMI.rt4
                      //
                      // 2 - use "Remote" profiles 1-12 for gscart/gcomp switches. Remote profile 1-8 for 1st gscart switch, 9-12 for inputs 1-4 on 2nd gscart switch.
                      //     inputs 5-8 on the 2nd gscart switch will use SVS profiles 213 - 216
                      //
                      //     - remote profiles 1-8 for 1st gScart, 9 - 12 for first 4 inputs on 2nd gScart (If S0 below is set to true - remote profile 12 is used when all ports are in-active)
                      //     - SVS 213 -  216 for remaining inputs 5 - 8 on 2nd gScart 
                      //     - SVS   1 -  99 for 1st Extron or TESmart
                      //     - SVS 101 - 199 for 2nd Extron or TESmart
                      //
                      //
                      //



bool const S0  = false;        // (Profile 0) 
                         //
                         //  ** Recommended to remove any /profile/SVS/S0_<user defined>.rt4 profiles and leave this option "false" if using in tandem with the Scalable Video Switch. **
                         //
                         // set "true" to load "Remote Profile 12" instead of "S0_<user definted>.rt4" (if SVS=0) when all ports are in-active on 1st Extron switch (and 2nd if connected). 
                         // You can assign it to a generic HDMI profile for example.
                         // If your device has a 12th input, SVS will be used instead. "If" you also have an active 2nd Extron Switch, Remote Profile 12
                         // will only load if "BOTH" switches have all in-active ports.
                         // 
                         // 
                         // If SVS=1, /profile/SVS/ "S0_<user defined>.rt4" will be used instead of Remote Profile 12
                         //
                         // If SVS=2, Remote Profile 12 will be used instead of "S0_<user defined>.rt4"
                         //
                         //
                         // default is false // also recommended to set false to filter out unstable Extron inputs that can result in spamming the RT4K with profile changes 
                       


////////////////////////// 
                        // Choosing the above two options can get quite confusing (even for myself) so maybe this will help a little more:
                        //
                        // when S0=0 and SVS=0, button profiles 1 - 12 are used for EXTRON sw1, and SVS for EVERYTHING else
                        // when S0=0 and SVS=1, SVS profiles are used for everything
                        // when S0=0 and SVS=2, button profiles 1 - 8 are used for GSCART sw1, 9 - 12 for GSCART sw2 (ports 1 - 4), and SVS for EVERYTHING else
                        // when S0=1 and SVS=0, button profiles 1 - 11 are used for EXTRON sw1 and Remote Profile 12 as "Profile S0", and SVS for everything else 
                        // when S0=1 and SVS=1, SVS profiles for everything, and uses S0_<user defined>.rt4 as "Profile 0" 
                        // when S0=1 and SVS=2, button profiles 1 - 8 are used for GSCART sw1, 9 - 11 for GSCART sw2 (ports 1 - 3) and Remote Profile 12 as "Profile S0", and SVS for EVERYTHING else
                        //
//////////////////////////



uint8_t const voutMatrix[65] = {1,  // MATRIX switchers // by default ALL input changes to any/all outputs result in a profile change
                                                   // disable specific outputs from triggering profile changes
                                                   //
                           1,  // output 1 (1 = enabled, 0 = disabled)
                           1,  // output 2
                           1,  // output 3
                           1,  // output 4
                           1,  // output 5
                           1,  // output 6
                           1,  // output 7
                           1,  // output 8
                           1,  // output 9
                           1,  // output 10
                           1,  // output 11
                           1,  // output 12
                           1,  // output 13
                           1,  // output 14
                           1,  // output 15
                           1,  // output 16
                           1,  // output 17
                           1,  // output 18
                           1,  // output 19
                           1,  // output 20
                           1,  // output 21
                           1,  // output 22
                           1,  // output 23
                           1,  // output 24
                           1,  // output 25
                           1,  // output 26
                           1,  // output 27
                           1,  // output 28
                           1,  // output 29
                           1,  // output 30
                           1,  // output 31
                           1,  // output 32 (1 = enabled, 0 = disabled)
                               //
                               // ONLY USE FOR 2ND MATRIX SWITCH
                           1,  // 2ND MATRIX SWITCH output 1 (1 = enabled, 0 = disabled)
                           1,  // 2ND MATRIX SWITCH output 2
                           1,  // 2ND MATRIX SWITCH output 3
                           1,  // 2ND MATRIX SWITCH output 4
                           1,  // 2ND MATRIX SWITCH output 5
                           1,  // 2ND MATRIX SWITCH output 6
                           1,  // 2ND MATRIX SWITCH output 7
                           1,  // 2ND MATRIX SWITCH output 8
                           1,  // 2ND MATRIX SWITCH output 9
                           1,  // 2ND MATRIX SWITCH output 10
                           1,  // 2ND MATRIX SWITCH output 11
                           1,  // 2ND MATRIX SWITCH output 12
                           1,  // 2ND MATRIX SWITCH output 13
                           1,  // 2ND MATRIX SWITCH output 14
                           1,  // 2ND MATRIX SWITCH output 15
                           1,  // 2ND MATRIX SWITCH output 16
                           1,  // 2ND MATRIX SWITCH output 17
                           1,  // 2ND MATRIX SWITCH output 18
                           1,  // 2ND MATRIX SWITCH output 19
                           1,  // 2ND MATRIX SWITCH output 20
                           1,  // 2ND MATRIX SWITCH output 21
                           1,  // 2ND MATRIX SWITCH output 22
                           1,  // 2ND MATRIX SWITCH output 23
                           1,  // 2ND MATRIX SWITCH output 24
                           1,  // 2ND MATRIX SWITCH output 25
                           1,  // 2ND MATRIX SWITCH output 26
                           1,  // 2ND MATRIX SWITCH output 27
                           1,  // 2ND MATRIX SWITCH output 28
                           1,  // 2ND MATRIX SWITCH output 29
                           1,  // 2ND MATRIX SWITCH output 30
                           1,  // 2ND MATRIX SWITCH output 31
                           1,  // 2ND MATRIX SWITCH output 32 (1 = enabled, 0 = disabled)
                           };
                           

                           // ** Must be on firmware version 3.7 or higher **
uint8_t const RT5Xir = 2;     // 0 = disables IR Emitter for RetroTink 5x
                              // 1 = enabled for Extron sw1 / alt sw1, TESmart HDMI, MT-ViKi, or Otaku Games Scart Switch if connected
                              //     sends Profile 1 - 10 commands to RetroTink 5x. Must have IR LED emitter connected.
                              //
                              // 2 = enabled for gscart switch only (remote profiles 1-8 for first gscart, 9-10 for first 2 inputs on second gscart)
                              //
                              // 3 = enabled for Extron sw2 / alt sw2, TESmart HDMI, MT-ViKi, or Otaku Games Scart Switch if connected 
                              //     sends Profile 1 - 10 commands to RetroTink 5x. Must have IR LED emitter connected.

uint8_t const OSSCir = 0;     // 0 = disables IR Emitter for OSSC
                              // 1 = enabled for Extron sw1 switch, TESmart HDMI, or Otaku Games Scart Switch if connected
                              //     sends Profile 1 - 14 commands to OSSC. Must have IR LED emitter connected.
                              //     
                              // 2 = enabled for gscart switch only (remote profiles 1-8 for first gscart, 9-14 for first 6 inputs on second gscart)

uint8_t const MTVIKIir = 0;   // Must have IR "Receiver" connected to the Donut Dongle for option 1 & 2.
                              // 0 = disables IR Receiver -> Serial Control for MT-VIKI 8 Port HDMI switch
                              //
                              // 1 = MT-VIKI 8 Port HDMI switch connected to "Extron sw1"
                              //     Using the RT4K Remote w/ the IR Receiver, AUX8 + profile button changes the MT-VIKI Input over Serial.
                              //     Sends auxprof SVS profiles listed below.
                              //
                              // 2 = MT-VIKI 8 Port HDMI switch connected to "Extron sw2"
                              //     Using the RT4K Remote w/ the IR Receiver, AUX8 + profile button changes the MT-VIKI Input over Serial.
                              //     Sends auxprof SVS profiles listed below. You can change them below to 101 - 108 to prevent SVS profile conflicts if needed.

uint8_t const auxprof[12] =   // Assign SVS profiles to IR remote profile buttons. 
                              // Replace 1, 2, 3, etc below with "ANY" SVS profile number.
                              // Press AUX8 then profile button to load. Must have IR Receiver connected and Serial connection to RT4K.
                              // 
                              {1,  // AUX8 + profile 1 button
                                2,  // AUX8 + profile 2 button
                                3,  // AUX8 + profile 3 button
                                4,  // AUX8 + profile 4 button
                                5,  // AUX8 + profile 5 button
                                6,  // AUX8 + profile 6 button
                                7,  // AUX8 + profile 7 button
                                8,  // AUX8 + profile 8 button
                                9,  // AUX8 + profile 9 button
                                10, // AUX8 + profile 10 button
                                11, // AUX8 + profile 11 button
                                12, // AUX8 + profile 12 button
                                };

uint8_t const gctl = 1; // 1 = Enables gscart/gcomp manual input selection.
                        // 0 = Disabled (default)
                        // ** Only supported on vers 5.x gscart/gcomp switches **
                        //
                        // AUX5 button + 1-8 button for gscart sw1, button 1 = input 1, etc
                        // AUX5 + 9-12 button to return to auto switching
                        //
                        // AUX6 button + 1-8 button for gscart sw2, button 1 = input 1, etc
                        // AUX6 + 9-12 button to return to auto switching
                        // 
                        // (RT5x and OSSC may require a repeat of the button combo for the IR signal to send.)

String const auxpower = "LG"; // AUX8 + Power button sends power off/on via IR Emitter. "LG" OLEX CX is the only one implemented atm. 

uint8_t const legacyOR[] = {1,2,3}; // For Legacy RT5x remote, when gctl = 1, you can use the bottom-most 3 buttons for manual input selection of gscart/gcomp inputs.
                                    //                         set to input 1, 2, and 3 as default. Values can be: 1 - 8, for gscart/gcomp sw1 only at the moment.
                                    //
                                    // Use the "Back/Exit" button to re-enable auto switching.
                                    //
                                    // ** Only supported on vers 5.x gscart/gcomp switches **

About

Arduino Nano based hub that connects your digital and analog console switching setup with the RetroTink 4K and/or RetroTink 5x/OSSC for Auto Profile switching

Resources

License

Stars

Watchers

Forks

Sponsor this project