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

Pushbutton

pushButton()

A simple, momentary pushbutton. The button numer is the one you set in your matrix setup.

void pushButton(int row, int col)

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

  • 1 button number

pushButtonL()

The button will become a latching button, so hitting it once will turn it on, hitting again will turn it off.

void pushButtonL(int row, int col)

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

  • 1 button number

pushButtonM()

Pushbutton with two modes:

  • 0: Momentary

  • 1: Latching

Uses the button field.

void pushButtonM(int row, int col, int fieldPlacement)

For a switch on row 3 column 5 -> pushButtonM(3,5,1);

Here the field placement is set to 1. So you'll find the mode of this switch in the 1st bit of the button field. Corresponding SimHub property is [DahlDesign.DDCB1].

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

  • 1 button number

pulseButton()

A button that gives a short pulse on pressing the button. Holding the button will not give a continous button press. Releasing the button will not give a button press. The button numer is the one you set in your matrix setup.

void pulseButton(int row, int col)

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

  • 1 button number

repeaterButton()

A button that gives multiple pulses on pressing the button. Holding the button will not give a continous pulses. Releasing the button will not give pulses. The button numer is the one you set in your matrix setup.

The purpose of this button is mainly for adjustments of in-car settings, such as brake bias, diff setting, traction control, etc. It will allow you to adjust several steps with a single press.

void repeaterButton(int row, int col, int pulseDuration, int repeats)

For a switch on row 3 column 5 with 10 pulses at 50 ms (will also have 50 ms brakes, meaning 10 pulses per second) -> repeaterButton(3,5,50,10);

  • 1 button number

PreviousSwitch libraryNextFunction switches

Last updated 1 year ago