\hypertarget{bumper_8c}{
\section{bumper.c File Reference}
\label{bumper_8c}\index{bumper.c@{bumper.c}}
}
{\tt \#include \char`\"{}t89c51cc02.h\char`\"{}}\par
{\tt \#include \char`\"{}datatypes.h\char`\"{}}\par
{\tt \#include \char`\"{}bumper.h\char`\"{}}\par
{\tt \#include \char`\"{}adc.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{bumper_8c_e58faeb4a76c07f77ab495f36b389e34}{
void \hyperlink{bumper_8c_e58faeb4a76c07f77ab495f36b389e34}{Bumper\_\-init} ()}
\label{bumper_8c_e58faeb4a76c07f77ab495f36b389e34}

\begin{CompactList}\small\item\em initialize bumper control subsystem \item\end{CompactList}\item 
void \hyperlink{bumper_8c_008615e7422810ecd3d0ac109a46d7fc}{Bumper\_\-select} (\hyperlink{datatypes_8h_92076741b75a8c2bdc5c24049c253d9a}{BYTE} sensorid)
\begin{CompactList}\small\item\em select one of the outer bumper sensors for measurement \item\end{CompactList}\item 
\hyperlink{datatypes_8h_89b917a7bdb582e19cbde98e817fa0b3}{WORD} \hyperlink{bumper_8c_e7ed27289e87e8fb758ef0f3fc648557}{Bumper\_\-read} (\hyperlink{datatypes_8h_92076741b75a8c2bdc5c24049c253d9a}{BYTE} bumpernr)
\begin{CompactList}\small\item\em reads one of the perimeter bumper sensors \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}


Definition in file \hyperlink{bumper_8c-source}{bumper.c}.

\subsection{Function Documentation}
\hypertarget{bumper_8c_e7ed27289e87e8fb758ef0f3fc648557}{
\index{bumper.c@{bumper.c}!Bumper_read@{Bumper\_\-read}}
\index{Bumper_read@{Bumper\_\-read}!bumper.c@{bumper.c}}
\subsubsection[Bumper\_\-read]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{datatypes_8h_89b917a7bdb582e19cbde98e817fa0b3}{WORD} Bumper\_\-read (\hyperlink{datatypes_8h_92076741b75a8c2bdc5c24049c253d9a}{BYTE} {\em bumpernr})}}
\label{bumper_8c_e7ed27289e87e8fb758ef0f3fc648557}


reads one of the perimeter bumper sensors 

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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bumpernr}]the bumper to be read (0-7) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the relative voltage reading of the specified bumper (+5V means no contact) \end{Desc}


Definition at line 57 of file bumper.c.

References ADC(), Bumper\_\-activate, Bumper\_\-deactivate, and Bumper\_\-select().

Referenced by main().\hypertarget{bumper_8c_008615e7422810ecd3d0ac109a46d7fc}{
\index{bumper.c@{bumper.c}!Bumper_select@{Bumper\_\-select}}
\index{Bumper_select@{Bumper\_\-select}!bumper.c@{bumper.c}}
\subsubsection[Bumper\_\-select]{\setlength{\rightskip}{0pt plus 5cm}void Bumper\_\-select (\hyperlink{datatypes_8h_92076741b75a8c2bdc5c24049c253d9a}{BYTE} {\em sensorid})}}
\label{bumper_8c_008615e7422810ecd3d0ac109a46d7fc}


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.\par
 The A Bus is connected to P2.0 P2.1 and P1.5 for A0 - A2.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sensorid}]- number of the bumper to be read \end{description}
\end{Desc}


Definition at line 33 of file bumper.c.

Referenced by Bumper\_\-read().