adc.h File Reference

#include "t89c51cc02.h"
#include "datatypes.h"

Go to the source code of this file.

Functions

void ADC_init (void)
 initialize A/D hardware
WORD ADC (BYTE)
 execute A/D conversion for specific input channel


Detailed Description

Definition in file adc.h.


Function Documentation

WORD ADC BYTE  channel  ) 
 

execute A/D conversion for specific input channel

Reads the voltage from the specified input source and does a standard conversion.
A reading of 0x0000 implies +0V while 0x03ff implies +5V

Parameters:
channel 0-7 the A/D channel we want to measure (corresponds to a pin number)
Returns:
conversion result as a 16Bit value

Definition at line 29 of file adc.c.

Referenced by Bumper_read(), Fingersensors_read(), Photosensor_read(), and Sharp_read().

void ADC_init void   ) 
 

initialize A/D hardware

The A/D converter of the T89C51CC02 is initialized to use P1.0 and P1.1 as analogue inputs. A standard conversion (see T89C51CC02 datasheet) is used.

Definition at line 13 of file adc.c.

Referenced by main().


Generated on Wed Oct 24 12:57:24 2007 for SensorControl by  doxygen 1.4.6