Changeset 784

Show
Ignore:
Timestamp:
08/05/08 21:49:41 (4 months ago)
Author:
liamstask
Message:

- revamp digitalout doc

Files:
1 modified

Legend:

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

    r771 r784  
    8989  If you've previously used any of the other systems on the outputs (steppers, motors, etc.), you'll need 
    9090  to set them to \b inactive to unlock the IO lines and use the Digital Outs. 
     91   
     92  See the <a href="http://www.makingthings.com/documentation/tutorial/application-board-overview/digital-outputs"> 
     93  Digital Out section</a> of the Application Board overview for more details. 
    9194* \ingroup Libraries 
    9295* @{ 
     
    9497 
    9598/** 
    96   Sets whether the specified Digital Out is active. 
    97   This is automatically called, setting the channel active, the first time DigitalOut_SetValue() is called.\n 
     99  Enable or disable a DigitalOut. 
     100  This is automatically called, setting the channel active, the first time DigitalOut_SetValue() is called. 
    98101  However, the channel must be explicitly set to inactive in order for any other devices to access the I/O lines.  
    99102  @param index An integer specifying which Digital Out (0-7). 
    100103  @param state An integer specifying the state - on (1) or off (0). 
    101104  @return Zero on success. 
     105   
     106  \b Example 
     107  \code 
     108  // Enable DigitalOut 6 
     109  DigitalOut_SetActive( 6, 1 ); 
     110  \endcode 
    102111*/ 
    103112int DigitalOut_SetActive( int index, int state ) 
     
    113122 
    114123/** 
    115   Returns the availability of the Digital Out I/O lines. 
     124  Read whether a DigitalOut is active. 
    116125  @param index An integer specifying which Digital Out (0-7). 
    117   @return State - on (1) or off (0). 
     126  @return Nonzero when active, 0 when inactive 
     127   
     128  \b Example 
     129  \code 
     130  if( DigitalOut_GetActive( 5 ) ) 
     131  { 
     132    // DigitalOut 5 is active 
     133  } 
     134  else 
     135  { 
     136    // DigitalOut 5 is inactive 
     137  } 
     138  \endcode 
    118139*/ 
    119140int DigitalOut_GetActive( int index ) 
     
    125146 
    126147/**  
    127   Turn a Digital Out on or off on the MAKE Application Board. 
     148  Turn a Digital Out on or off. 
    128149  @param index An integer specifying which Digital Out (0-7). 
    129150  @param state An integer specifying the state - on (1) or off (0). 
    130151  @return Zero on success. 
     152   
     153  \b Example 
     154  \code 
     155  // Turn digital out 2 on 
     156  DigitalOut_SetValue( 2, 1 ); 
     157  \endcode 
    131158*/ 
    132159int DigitalOut_SetValue( int index, int state ) 
     
    152179 
    153180/**  
    154   Read the value of a Digital Out on the Make Application Board. 
     181  Read whether a DigitalOut is on or off. 
    155182  @param index An integer specifying which Digital Out (0-7). 
    156183  @return The value - on (1) or off (0). 
     184   
     185  \b Example 
     186  \code 
     187  if( DigitalOut_GetValue( 2 ) ) 
     188  { 
     189    // DigitalOut 2 is high 
     190  } 
     191  else 
     192  { 
     193    // DigitalOut 2 is low 
     194  } 
     195  \endcode 
    157196*/ 
    158197int DigitalOut_GetValue( int index )