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
  2. Pedals & paddles

Shifter

PreviousFiltered curvesNextFunky switch

Last updated 1 year ago

Normally, you'll just use for shifters. Here are special shifter functions which have some added features.

pushPull()

A function that sets up 4 buttons as a pair of push/pull shifters. Can also of course be used with two shifter paddles and 2 pushbuttons, or 4 shifter paddles (as the SW1 wheel uses it).

  • 2 modes:

    • 0: Complex -> The 4 buttons only controls 2 button numbers. For instance, right shifter has button numbers 4 on pull, 5 on push. The left shifter will then have 5 on pull, 4 on push. This allows you to gear up/down with either hand on the wheel.

    • 1: Individual -> The 4 buttons are split up and uses 4 button numbers.

The button numbers will start with whatever is set up in the slot for the right side pull button in the matrix, and count 3 more from there. So for the other 3 buttons used you dont need to set up a button number in the matrix (can be set to 0, or anything else, it wont be read).

In addition, it has a handbrake feature. Pressing left and right pull buttons together for 1 second will engage "handbrake", which is 100% brake force from the controllers brake axis. Works great with sims that allow you to map a secondary brake axis (iRacing). The controller doesn't need clutch paddles for this to work. To release the handbrake, simply hold the left and right push buttons for 1 second.

  • If handbrake is active or not is shown in property [DahlDesign.DDChandbrakeActive]

  • The mode uses the button field. void pushPull(int rightPullRow, int rightPullCol, int rightPushRow, int rightPushCol, int leftPullRow, int leftPullCol, int leftPushRow, int leftPushCol, int fieldPlacement);

void pushPull(int rightPullRow, int rightPullCol, int rightPushRow, int rightPushCol, int leftPullRow, int leftPullCol, int leftPushRow, int leftPushCol, int fieldPlacement)

The buttons we're planning to use:

  • Right shifter pull: Row 2 Column 1

  • Right shifter push: Row 3 Column 3

  • Left shifter pull: Row 3 Column 5

  • Left shifter push: Row 1 Coumn 2

Resulting in -> pushPull(2, 1, 3, 3, 3, 5, 1, 2, 4);

As you can see, the fieldPlacement is set to 4. This function uses the button field, so you'll find the mode of your push/pull complex in the property [DahlDesign.DDCB4].

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

  • 4 button numbers

upshift()

A simple, momentary pushbutton. It differs from pushButton() in that is has an adjustable cooldown. You can use this to prevent double upshift caused by holding/releasing the shifter paddle too slowly.

void upshift(int row, int col, int cooldown)

For a switch on row 3 column 5 -> upshift(3,5,250);

I this case, the button takes a 250 ms pause after being pushed.

  • 1 button number

downshiftAndReverse()

This function allows you to set up a button to pair with your downshift paddle. They will share button number, and the purpose is to use this button to set the car in reverse. It will pulse 10 button presses in 1 second.

2 modes:

  • 0: Reverse button mode: A regular pushbutton (your paddle) and a 10 x pulse button (your reverse button) will share button number

  • 1: Individual mode: Both buttons are regular pushbuttons with each their own button number.

Hold modButton() and press the reverse button to swap modes.

void downshiftAndReverse(int drow, int dcol, int rrow, int rcol, int fieldPlacement)

Example:

  • Paddle shifter on row 3 column 1

  • Reverse button on row 1 column 2

  • Use field bit 1 to push the switch mode to SimHub property [DahlDesign.DDCB1]

downshiftAndReverse(3,1,1,2,1);

  • 2 button number

pushButton()