Show
Ignore:
Timestamp:
08/05/08 21:42:47 (5 months ago)
Author:
liamstask
Message:

- revamp doc for digitalin

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • firmware/trunk/libraries/digitalin/digitalin.c

    r771 r783  
    5555 
    5656/** \defgroup DigitalIn Digital Inputs 
    57 * The Digital In subsystem reads the 8 inputs on the Make Controller as digital values - 1 (on) or 0 (off).   
    58   The 8 inputs can be either read as digital inputs by DigitalIn or as \ref AnalogIn. 
     57* Read the 8 inputs on the Make Controller as digital values - 1 (on) or 0 (off).   
     58  The 8 inputs can be either read as digital inputs by DigitalIn or as \ref AnalogIn.   
     59  Because inputs 4-7 are actually AnalogIn lines, there's no performance gain to reading 
     60  those as DigitalIns. 
    5961* \ingroup Libraries 
    6062* @{ 
     
    6668  @param state An integer specifying the state - 1 (active) or 0 (inactive). 
    6769  @return Zero on success. 
     70   
     71  \b Example 
     72  \code 
     73  // Enable DigitalIn 3 
     74  DigitalIn_SetActive(3, 1); 
     75  \endcode 
    6876*/ 
    6977int DigitalIn_SetActive( int index, int state ) 
     
    8290  @param index An integer specifying which Digital In (0-7). 
    8391  @return Zero if inactive, non-zero if active. 
     92   
     93  \b Example 
     94  \code 
     95  if( DigitalIn_GetActive(3) ) 
     96  { 
     97    // DigitalIn 3 is active 
     98  } 
     99  else 
     100  { 
     101    // DigitalIn 3 is inactive 
     102  } 
     103  \endcode 
    84104*/ 
    85105int DigitalIn_GetActive( int index ) 
     
    94114  If the voltage on the input is greater than ~0.6V, the Digital In will read high. 
    95115  @param index An integer specifying which Digital In (0-7). 
    96   @return The value - 1 (high) or 0 (low). 
     116  @return Non-zero when high, 0 when low 
     117   
     118  \b Example 
     119  \code 
     120  if( DigitalIn_GetValue(5) ) 
     121  { 
     122    // DigitalIn 5 is high 
     123  } 
     124  else 
     125  { 
     126    // DigitalIn 5 is low 
     127  } 
     128  \endcode 
    97129*/ 
    98130int DigitalIn_GetValue( int index )