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. Multiswitch complexes

Modded encoder

PreviousMultifunction rotaryNextStacked encoder

Last updated 1 year ago

"Modded" encoders are standard incremental encoders with two extra button numbers available by holding the . Lets say your encoders produces button numbers 14 and 15 on CW and CCW rotation. Holding the modButton will change the numbers to 16 and 17.

This is just free extra buttons, which could be useful for settings/adjustments that you don't do that often. You could have a rotary with brake balance adjustment, and ABS adjustment when holding modButton. Or a rotary to control your dash pages, and change dash template on holding modButton.

If you have a backlit encoder, you could use the function to change colors when holding modbutton:

triggerLED(9,12,!modButtonPressed(),0xFF0000,25,true,false);
triggerLED(9,12,modButtonPressed(),0x00FF00,25,true,false);

The first line will color the LEDs 9 to 12 red (0xFF0000) if modButton is not pressed. The second line will color LEDs 9 to 12 green (0x00FF00) if modButton is pressed. Brightness is set to 25% on both, clearing LEDs is set to TRUE and blinking is set to FALSE.

rotary2Mod()

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

Lets say our encoder is on row 3, columns 2+3,

rotary2Mod(3,2,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 when modButton is NOT pressed, and then 17+18 if the modButton is pressed. The reverse part of the function will switch the button numbers if set to true.

  • 4 button numbers

  • modButton

rotary4Mod()

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

Lets say our encoder is on row 3, columns 2+3,

rotary4Mod(3,2,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 when modButton is NOT pressed, and then 17+18 if the modButton is pressed. The reverse part of the function will switch the button numbers if set to true.

  • 4 button numbers

  • modButton

PEC11Mod()

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

Lets say our encoder is on row 3, columns 2+3,

PEC11Mod(3,2,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 when modButton is NOT pressed, and then 17+18 if the modButton is pressed. The reverse part of the function will switch the button numbers if set to true.

  • 4 button numbers

  • modButton

funkyRotaryMod()

void funkyRotaryMod(int row, int aCol, int bCol, bool reverse)

Lets say our encoder is on row 3, columns 2+3,

funkyRotaryMod(3,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 when modButton is NOT pressed, and then 17+18 if the modButton is pressed. The reverse part of the function will switch the button numbers if set to true.

  • 4 button numbers

  • modButton

Modded encoder in the rotary2bit .

Modded encoder in the rotary4bit.

Modded encoder in the PEC11 .

Modded encoder in the funkyRotary . This is for using a regular pushbutton to change layer, not the funky pushbutton.

category
category
category
category
modButton
triggerLED()