Digital Class

Configures and reports digital inputs via Arduino pins defined in the firmware profile. By default the input pins are A0 to A4, but can be overridden for a specific profile using firmware macro DIGITAL_INPUT_PINS. Digital inputs are identified by their index position. I.e. index 0 by default corresponds to A0, index 1 to A1 etc.

Definition

Namespace: RoboTx.Api
Assembly: RoboTx.Api (in RoboTx.Api.dll) Version: 1.0.0
C#
public sealed class Digital
Inheritance
Object    Digital

Properties

IN0 Gets the digital reading for input 0 whose value is either true or false. The corresponding pin must be enabled for digital input before values become available.
IN1 Gets the digital reading for input 1 whose value is either true or false. The corresponding pin must be enabled for digital input before values become available.
IN2 Gets the digital reading for input 2 whose value is either true or false. The corresponding pin must be enabled for digital input before values become available.
IN3 Gets the digital reading for input 3 whose value is either true or false. The corresponding pin must be enabled for digital input before values become available.
IN4 Gets the digital reading for input 4 whose value is either true or false. The corresponding pin must be enabled for digital input before values become available.
InputCount Returns the number of digital inputs that are set to true.

Methods

ClearInputEvents Clears queued inputs from the internal buffer and resets the current readings to false. Clears for the duration specified by parameter timeoutMs.
DisableInputs Disables digital inputs and events whose sources are Arduino pins defined in the firmware profile. Analog inputs for corresponding Arduino pins are disabled. The inverted configuration of any disabled inputs are reset. Input pins are identified by their index position in the list of Arduino pins in firmware macro DIGITAL_INPUT_PINS.
EnableInputs Enables digital inputs and events whose sources are Arduino pins defined in the firmware profile. A short delay may need to be implemented after a call to this method to allow digital values to start being received. Enable only the input sources that are needed. Analog inputs for corresponding Arduino pins are disabled. Input pins are identified by their index position in the list of Arduino pins in firmware macro DIGITAL_INPUT_PINS.
GetInputEvent If an input event (e.g. button press) has been detected, get its value or return -1 otherwise. Use class Input for symbolic labels for input events. Input events are only detected for Arduino pins that have been enabled.
InvertInputs Configures Arduino digital inputs to be detected on Low (inverted) signal. This method should be called before enabling any pins for digital input. Input pins are identified by their index position in the list of Arduino pins in firmware macro DIGITAL_INPUT_PINS.
ResetInputsState Resets the state of the specified inputs from true to false. Input pins are identified by their index position in the list of Arduino pins in firmware macro DIGITAL_INPUT_PINS.
ToString Returns the digital inputs as a binary string.
(Overrides ObjectToString)

See Also