DDC
  • Welcome
    • Introduction
    • Supported hardware
  • 1: Project planning
    • Switch inputs
      • Switch table
      • Direct
      • Shift register
      • Port expander
    • Analog inputs
      • External ADC
    • RGB LED
    • Digital outputs
    • PWM / Circuit control
    • EEPROM
    • Processing and memory
  • 2. Wiring
    • Switch inputs
      • Matrix
      • Direct
      • Shift register
      • Port expander
    • Analog
      • Analog switches
      • External ADC
    • RGB LED
    • Digital outputs
    • PWM / Circuit control
    • EEPROM
  • 3. Coding
    • Essentials
      • 02_Board.ino
      • 08_Joystick
      • 10_TableAndAnalog.ino
        • Switch table
        • Analog channels
      • 30_Switches.ino
    • Peripherals
      • RGB LED
        • Firmware control
          • LED functions
          • Color
          • Brightness
          • Presets
        • SimHub control
      • Digital outputs
        • Setup
        • SimHub control
        • Firmware control
      • PWM / Circuit control
        • Setup
        • Calibrate
        • Switch control
        • Trigger control
      • Shift register
      • I2C devices
        • ADS1115
        • PCA9555
        • CAT24C512
    • Advanced
      • Analog inject
      • Conditional coding
        • Triggers
        • Editors
      • Field placement
      • Presets
        • 31_RunningPresets.ino
        • 32_Presets.ino
        • Example
    • Upload
    • Naming the controller
  • 4. Connect to SimHub
    • LED control
    • Controller settings and properties
      • How to connect?
      • How does it work?
      • How to control it?
      • Property list
  • Switch library
    • Pushbutton
    • Function switches
    • Toggle switches
    • Hat switches
    • Car control functions
      • QuickSwitch
      • BrakeMagic
      • ThrottleHold
      • Handbrake
    • Pedals & paddles
      • Brake/throttle
      • Clutch
      • Bite point & launch
      • Filtered curves
      • Shifter
    • Funky switch
      • Directional
      • Center push
    • Encoders
      • rotary2Bit
      • rotary4Bit
      • funkyRotary
      • wildEncoder
      • E18
      • rotaryPulse
      • PEC11
    • Rotary switches
      • rotaryAnalog
      • quickRotary
      • SW1
      • Editing functions
    • Multiswitch complexes
      • Hybrid rotary
      • Multifunction rotary
      • Modded encoder
      • Stacked encoder
    • Preset
    • DDS
    • RGB LED control
    • PWM / Circuit control
    • Utility
  • Fast DDC
    • Buttons and LED
    • 4 encoders, buttons and LED
    • Dual clutches, 4 encoders, buttons and LED
    • Dual clutches, 6 encoders, button matrix and LED
  • CB1
    • Ordering
      • Order together
      • Order yourself
        • 1. Open in EasyEDA
        • 2. Export files
        • 3. Edit Pick&Place
        • 4. Pin headers and jumper
        • 5. Order from JLCPCB
    • Wiring
    • Code
      • Essentials
      • Complete project
      • Settings
    • Circuit
    • Shields
      • Robin
  • Collaboration
Powered by GitBook
On this page
  1. Switch library

DDS

PreviousPresetNextRGB LED control

Last updated 1 year ago

DDS (Dahl Design Switch) switches are tailored for the Dahl Design iRacing , but can of course be used any way you like, if it fits your projects. It is a function that takes a rotary switch and two pushbuttons to create a 26-position switch complex that is ideal for a menu system.

In the example above, the switch has button numbers 1 to 26. It works like this:

  • The rotary switch will scroll through numbers 1-12 OR numbers 13-24. A continous button press is produced.

  • The DDButton will toggle between the two rows of 12 numbers. So if you're currently pressing "9" and hit the DDButton, you go to "21". If you're at "14" and press DDButton, you go to "2".

  • The hybridButton will lock the position the switch is currently in, and rotating the rotary now will give pulses of buttons 26/25 on CW/CCW rotation. Hitting hybridButton again will release back to being able to change the position.

    • The state when the position is locked is refered to as "closed hybrid".

    • The state when position can move is refered to as "open hybrid".

In the open hybrid mode the switch is a counting multiposition switch, as opposed to being an absolute multiposition switch. So phyisical position of the switch will be out of sync with button numbers. This is to allow the switch to continue where it stopped after being rotated in closed hybrid. The switch will boot to the button number it is given in 10_MatrixAndAnalog.ino.

The DDS switches all have 4 modes, and this is automatically pushed to the bit fields for SimHub communication. It is available as the property [DahlDesign.DDCDDSMode]:

  • 0: Open hybrid

  • 1: Closed hybrid

  • 2 and 3 depends on the type of DDS function you use.

The video below you can see how the DDS switch works together with the dashboard. Here, a funky switch alone has all the switches needed for the complex; including the rotary, DDButton and hybridButton.

All DDS switches can also set the bite point of your clutches.

DDS2bit()

DDS for an encoder in the rotary2bit category.

Modes:

  • 0: Open hybrid

  • 1: Closed hybrid

  • 2: 4-position switch

  • 3: Incremental encoder

void DDS2bit(int row, int column, bool reverse)

For a encoder on row 2 column 4+5 -> DDS2bit(2,4, true);

This switch has "reverese" set to true, since it is placed on the rear of the controller. Turning it CCW will now increase the count instead of reducing.

  • modButton() if you want to change modes freely. modButton() not needed to change modes across presets.

  • DDButton() to swap between "layers" of 12 positions.

  • hybridButton() to lock position and use rotary as incremental switch.

  • biteButton() to set the bite point of clutches.

  • 26 button numbers

DDS4bit()

DDS for an encoder in the rotary4bit category.

Modes:

  • 0: Open hybrid

  • 1: Closed hybrid

  • 2: 16-position switch. Absolute.

  • 3: Incremental encoder

void DDS4bit(int row, int column, bool reverse)

For a encoder on row 2 column 2+3+4+5 -> DDS4bit(2,4, true);

This switch has "reverese" set to true, since it is placed on the rear of the controller. Turning it CCW will now increase the count instead of reducing.

  • modButton() if you want to change modes freely. modButton() not needed to change modes across presets.

  • DDButton() to swap between "layers" of 12 positions.

  • hybridButton() to lock position and use rotary as incremental switch.

  • biteButton() to set the bite point of clutches.

  • 26 button numbers

DDSfunky()

DDS for an encoder in the funky category.

Modes:

  • 0: Open hybrid

  • 1: Closed hybrid

  • 2: Incremental encoder

  • 3: Toggle mode. Rotating CW/CCW will turn the button numbers for incremental mode on/off and hold them.

void DDSfunky(int Arow, int Acol, int Bcol)

For a encoder on row 2 column 2 + 4 -> DDS4bit(2, 2, 4);

As you can see, this encoder doesn't require the encoder A and B pins to be on columns next to eachother.

  • modButton() if you want to change modes freely. modButton() not needed to change modes across presets.

  • DDButton() to swap between "layers" of 12 positions.

  • hybridButton() to lock position and use rotary as incremental switch.

  • biteButton() to set the bite point of clutches.

  • 26 button numbers

DDSanalog()

DDS for a resistor ladder switch.

Modes:

  • 0: Open hybrid

  • 1: Closed hybrid

  • 2: 12-position switch. Absolute.

  • 3: Incremental switch

void DDSanalog(int analogChannel, int pos1, int pos2, int pos3, int pos4, int pos5, int pos6, int pos7, int pos8, int pos9, int pos10, int pos11, int pos12, bool reverse)

Switch setup with explainations:

DDSanalog(

2, <- Analog channel

16, 107, 200, 291, 383, 474, 566, 657, 749, 841, 932, 1023, <- Switch position values

false); <- Direction is not reversed, so CW rotation increasese button number.

So typed out in 30_Switches.ino:

DDSanalog(2, 16, 107, 200, 291, 383, 474, 566, 657, 749, 841, 932, 1023,false);

  • modButton() if you want to change modes freely. modButton() not needed to change modes across presets.

  • DDButton() to swap between "layers" of 12 positions.

  • hybridButton() to lock position and use rotary as incremental switch.

  • biteButton() to set the bite point of clutches.

  • 26 button numbers

If your controller uses a DDS switch, you have to check for this in the properties .

Set the bite point using a

Set the bite point using a

Set the bite point using a

Set the bite point using a

biteButton().
biteButton().
biteButton().
biteButton().
Dashboard
plugin menu