Skip to content
Talbot edited this page Nov 25, 2021 · 1 revision

Class Name

AnalogMultiPosT

Description

Used to have an analog device such as a potentiometer act as an multi position (ON-OFF) switch in DCS.

Standard Template Name

AnalogMultiPos

Constructor

AnalogMultiPosT(const char *msg, char pin, char numOfSteps_)

  • msg - The message to send to DCS when the switch position is changed.
  • pin - The analog pin connected to the control.
  • numOfSets - The number of sections to divide the analog range into. Steps start at "0" and go to "numOfSteps-1" and send the corresponding value to DCS.

Template

template <unsigned long pollIntervalMs = POLL_EVERY_TIME>

  • pollIntervalMs - Time in milliseconds between times this control should be sampled. Increase for less time sensitive controls to lower the CPU load required for this control.

Example 1

DcsBios::AnalogMultiPos("TACAN_MODE", 1, 5); // An analog device connected to pin 1 to send the 5 possible values for TACAN_MODE

Example 2

typedef DcsBios::AnalogMultiPosT<200> LowPriorityAnalogMultiPos; // A custom template instantiation that will use less cpu on each loop

LowPriorityAnalogMultiPos("AAP_PAGE", 1, 5);