bumper.c File Reference

#include "t89c51cc02.h"
#include "datatypes.h"
#include "bumper.h"
#include "adc.h"

Go to the source code of this file.

Functions

void Bumper_init ()
 initialize bumper control subsystem
void Bumper_select (BYTE sensorid)
 select one of the outer bumper sensors for measurement
WORD Bumper_read (BYTE bumpernr)
 reads one of the perimeter bumper sensors


Detailed Description

Definition in file bumper.c.


Function Documentation

WORD Bumper_read BYTE  bumpernr  ) 
 

reads one of the perimeter bumper sensors

A given bumper sensor is selected and then being read with the A/D converter.

Parameters:
bumpernr the bumper to be read (0-7)
Returns:
the relative voltage reading of the specified bumper (+5V means no contact)

Definition at line 57 of file bumper.c.

References ADC(), Bumper_activate, Bumper_deactivate, and Bumper_select().

Referenced by main().

void Bumper_select BYTE  sensorid  ) 
 

select one of the outer bumper sensors for measurement

A 74HCT237 decoder IC is used to select one of the bumpers. This function applies the sensor address to its A bus.
The A Bus is connected to P2.0 P2.1 and P1.5 for A0 - A2.

Parameters:
sensorid - number of the bumper to be read

Definition at line 33 of file bumper.c.

Referenced by Bumper_read().


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