Digital Inputs
[Libraries]

Read the 8 inputs on the Make Controller as digital values - 1 (on) or 0 (off). More...


Functions

int DigitalIn_SetActive (int index, int state)
 Sets whether the specified Digital In is active.
int DigitalIn_GetActive (int index)
 Returns the active state of the Digital In.
int DigitalIn_GetValue (int index)
 Read the value of a Digital Input on the MAKE Application Board.

Detailed Description

Read the 8 inputs on the Make Controller as digital values - 1 (on) or 0 (off).

The 8 inputs can be either read as digital inputs by DigitalIn or as Analog Inputs. Because inputs 4-7 are actually AnalogIn lines, there's no performance gain to reading those as DigitalIns.


Function Documentation

int DigitalIn_GetActive ( int  index  ) 

Returns the active state of the Digital In.

Parameters:
index An integer specifying which Digital In (0-7).
Returns:
Zero if inactive, non-zero if active.
Example
  if( DigitalIn_GetActive(3) )
  {
    // DigitalIn 3 is active
  }
  else
  {
    // DigitalIn 3 is inactive
  }

Definition at line 105 of file digitalin.c.

int DigitalIn_GetValue ( int  index  ) 

Read the value of a Digital Input on the MAKE Application Board.

If the voltage on the input is greater than ~0.6V, the Digital In will read high.

Parameters:
index An integer specifying which Digital In (0-7).
Returns:
Non-zero when high, 0 when low
Example
  if( DigitalIn_GetValue(5) )
  {
    // DigitalIn 5 is high
  }
  else
  {
    // DigitalIn 5 is low
  }

Definition at line 130 of file digitalin.c.

int DigitalIn_SetActive ( int  index,
int  state 
)

Sets whether the specified Digital In is active.

Parameters:
index An integer specifying which Digital In (0-7).
state An integer specifying the state - 1 (active) or 0 (inactive).
Returns:
Zero on success.
Example
  // Enable DigitalIn 3
  DigitalIn_SetActive(3, 1);

Definition at line 77 of file digitalin.c.