Changeset 783
- Timestamp:
- 08/05/08 21:42:47 (4 months ago)
- Files:
-
- 1 modified
-
firmware/trunk/libraries/digitalin/digitalin.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
firmware/trunk/libraries/digitalin/digitalin.c
r771 r783 55 55 56 56 /** \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. 59 61 * \ingroup Libraries 60 62 * @{ … … 66 68 @param state An integer specifying the state - 1 (active) or 0 (inactive). 67 69 @return Zero on success. 70 71 \b Example 72 \code 73 // Enable DigitalIn 3 74 DigitalIn_SetActive(3, 1); 75 \endcode 68 76 */ 69 77 int DigitalIn_SetActive( int index, int state ) … … 82 90 @param index An integer specifying which Digital In (0-7). 83 91 @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 84 104 */ 85 105 int DigitalIn_GetActive( int index ) … … 94 114 If the voltage on the input is greater than ~0.6V, the Digital In will read high. 95 115 @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 97 129 */ 98 130 int DigitalIn_GetValue( int index )
