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. 1: Project planning

Analog inputs

PreviousPort expanderNextExternal ADC

Last updated 8 months ago

DDC supports an unlimited number of analog switches (clutches, potentiometer, multiposition switches). Analog switches are not set up in the , but instead set up in analog channels.

When adding analog switches to your project (potentiometer, resistor ladder rotary, hall sensors, load cells, etc.), you'll build a channel for each switch. A channel will contain all the information related to that switch, including its analog pin, button numbers used, switch modes, readout values, cooldown timers, rotary switch position and more under-the-hood stuff to make the algorithms work.

When your switch has its own channel, you'll have the freedom of tapping into this channel for various software features, such as having values from this channel trigger RGB LEDs, PWM signal firing, or even build virtual switches in the switch table by using

When planning your analog channels, there are 3 things you should note for each channel:

  • Pin number: The analog pin this switch is wired to.

  • Button number: In case this switch needs some buttons numbers, note the starting button number. So if this is a 12-position switch and you want it to use button numbers 25-36, then 25 is your number.

  • Alternate button number: In case your switch has several switch modes, you can use different button numbers in different modes. For instance, you can have your 12-position switch using button numbers 25-36 in 12-position mode, but when set to incremental mode it uses button number 10 and 11. As above, the starting button number is what you should note, so 10 in this case.

Keep in mind, the RP2040 microcontroller can have its ADC giving you higher resolution analog signals without any drawback.

analogInject.
How you can imagine an analog channel holding all the necessary information for an analog switch.
switch table
oversampled,