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

Preset

PreviousStacked encoderNextDDS

Last updated 2 months ago

Have a look at for info on the preset system.

There are fuctions that can be used to change preset. Not included here is (), which has a seperate page.

preset2Bit()

Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher.

Added function is the ability to change presets. If holding the , rotating this switch will more to a higher/lower preset.

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

For an encoder with pins A and B to columns 3 and 4. Common pin to row 2:

preset2Bit(2, 3, false);

The button numbers used is determined by the number written in the block for the A pin. B pin block will not be read. If button number was set to 15, the switch will use buttons 15 and 16. The reverse part of the function will switch the button numbers if set to true.

  • 2 button numbers

  • modButton() to be able to change presets

E18Preset()

Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher.

Added function is the ability to change presets. If holding the , rotating this switch will more to a higher/lower preset.

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

For an encoder with pins A and B to columns 3 and 4. Common pin to row 2:

E18Preset(2, 3, false);

The button numbers used is determined by the number written in the block for the A pin. B pin block will not be read. If button number was set to 15, the switch will use buttons 15 and 16. The reverse part of the function will switch the button numbers if set to true.

  • 2 button numbers

  • modButton() to be able to change presets

PEC11Preset()

Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher.

Added function is the ability to change presets. If holding the , rotating this switch will more to a higher/lower preset.

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

For an encoder with pins A and B to columns 3 and 4. Common pin to row 2:

PEC11Preset(2, 3, false);

The button numbers used is determined by the number written in the block for the A pin. B pin block will not be read. If button number was set to 15, the switch will use buttons 15 and 16. The reverse part of the function will switch the button numbers if set to true.

  • 2 button numbers

  • modButton() to be able to change presets

funkyPreset()

Standard incremental encoder setup. Rotating CW will give a button pulse, rotating CCW will give a button pulse with a button number 1 value higher.

Added function is the ability to change presets. If holding the , rotating this switch will more to a higher/lower preset.

void funkyPreset(int row, int Acol, int Bcol, bool reverse)

For an encoder with pins A and B to columns 3 and 4. Common pin to row 2:

funkyPreset(2, 3, 4, false);

The button numbers used is determined by the number written in the block for the A pin. B pin block will not be read. If button number was set to 15, the switch will use buttons 15 and 16. The reverse part of the function will switch the button numbers if set to true.

  • 2 button numbers

  • modButton() to be able to change presets

presetNext()

A simple, momentary push button that goes to next preset when hit. Does not produce a button number press.

void presetNext(int row, int col)

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

  • None

presetPrevious()

A simple, momentary push button that goes to prevous preset when hit. Does not produce a button number press.

void presetPrevious(int row, int col)

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

  • None

this page
modButton()
modButton()
modButton()
modButton()
SW1PresetRotary