AnalogToDigital and DigitalToAnalog Blocks

AnalogToDigital

Converts an Analog value (number) to a Digital value (boolean).

An analog value is received in input and if it is equal to zero, the output is set to FALSE.

Otherwise, if the input number is different than zero, the output is set to TRUE.

Input:

  • val (number)

Output:

  • result (boolean)

DigitalToAnalog

Converts a Digital value (boolean) to an Analog value (number).

A digital value is received in input and if the value is FALSE, the output is set to 0.

Otherwise, if the input is TRUE, the output is set to 1.

Input:

  • val (boolean)

Output:

  • result (number)