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. |
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.
int DigitalIn_GetActive | ( | int | index | ) |
Returns the active state of the Digital In.
index | An integer specifying which Digital In (0-7). |
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.
index | An integer specifying which Digital In (0-7). |
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.
index | An integer specifying which Digital In (0-7). | |
state | An integer specifying the state - 1 (active) or 0 (inactive). |
// Enable DigitalIn 3 DigitalIn_SetActive(3, 1);
Definition at line 77 of file digitalin.c.