\doxysection{Me\+Mega\+Pi\+DCMotor Class Reference}
\hypertarget{class_me_mega_pi_d_c_motor}{}\label{class_me_mega_pi_d_c_motor}\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}}


Driver for Me Megapi DC motor device.  




{\ttfamily \#include $<$src/\+Me\+Mega\+Pi\+DCMotor.\+h$>$}

\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_me_mega_pi_d_c_motor_a514ff2f2c60e28567f803b75c95b59ca}{Me\+Mega\+Pi\+DCMotor}} (void)
\item 
\mbox{\hyperlink{class_me_mega_pi_d_c_motor_acbd1227d383653d78ae751377b2ed516}{Me\+Mega\+Pi\+DCMotor}} (uint8\+\_\+t port)
\item 
\mbox{\hyperlink{class_me_mega_pi_d_c_motor_ad53dab0d6fd9ccbfaef1d53f229cfe8a}{Me\+Mega\+Pi\+DCMotor}} (uint8\+\_\+t dc\+\_\+dir\+\_\+h1, uint8\+\_\+t dc\+\_\+dir\+\_\+h2, uint8\+\_\+t pwm\+\_\+pin)
\item 
void \mbox{\hyperlink{class_me_mega_pi_d_c_motor_a01f48a77e9fac7dcda0bba9dea5752aa}{reset}} (uint8\+\_\+t port)
\item 
void \mbox{\hyperlink{class_me_mega_pi_d_c_motor_a8d46dbfbce3b5f38622eb6f3febd4feb}{setpin}} (uint8\+\_\+t dc\+\_\+dir\+\_\+h1, uint8\+\_\+t dc\+\_\+dir\+\_\+h2, uint8\+\_\+t pwm\+\_\+pin)
\item 
void \mbox{\hyperlink{class_me_mega_pi_d_c_motor_ac324a1423bf3c3ed73e5df7ea9b2b92a}{run}} (int16\+\_\+t speed)
\item 
void \mbox{\hyperlink{class_me_mega_pi_d_c_motor_a1df48e25908553976462a4d0e4413eda}{stop}} (void)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Driver for Me Megapi DC motor device. 

Class\+: \doxylink{class_me_mega_pi_d_c_motor}{Me\+Mega\+Pi\+DCMotor} \begin{DoxyParagraph}{Description}
Declaration of Class \doxylink{class_me_mega_pi_d_c_motor}{Me\+Mega\+Pi\+DCMotor}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Copyright (C), 2012-\/2016, Make\+Block}

\end{DoxyParagraph}


\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{class_me_mega_pi_d_c_motor_a514ff2f2c60e28567f803b75c95b59ca}\label{class_me_mega_pi_d_c_motor_a514ff2f2c60e28567f803b75c95b59ca} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{MeMegaPiDCMotor()}{MeMegaPiDCMotor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily Me\+Mega\+Pi\+DCMotor\+::\+Me\+Mega\+Pi\+DCMotor (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Alternate Constructor which can call your own function to map the DC motor to arduino port, no pins are used or initialized here. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em None} & \\
\hline
\end{DoxyParams}
\Hypertarget{class_me_mega_pi_d_c_motor_acbd1227d383653d78ae751377b2ed516}\label{class_me_mega_pi_d_c_motor_acbd1227d383653d78ae751377b2ed516} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{MeMegaPiDCMotor()}{MeMegaPiDCMotor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily Me\+Mega\+Pi\+DCMotor\+::\+Me\+Mega\+Pi\+DCMotor (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{port }\end{DoxyParamCaption})}

Alternate Constructor which can call your own function to map the DC motor to arduino port 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em port} & -\/ megapi dc port from PORT\+\_\+1 to PORT\+\_\+12 \\
\hline
\end{DoxyParams}
\Hypertarget{class_me_mega_pi_d_c_motor_ad53dab0d6fd9ccbfaef1d53f229cfe8a}\label{class_me_mega_pi_d_c_motor_ad53dab0d6fd9ccbfaef1d53f229cfe8a} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{MeMegaPiDCMotor()}{MeMegaPiDCMotor()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily Me\+Mega\+Pi\+DCMotor\+::\+Me\+Mega\+Pi\+DCMotor (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{dc\+\_\+dir\+\_\+h1,  }\item[{uint8\+\_\+t}]{dc\+\_\+dir\+\_\+h2,  }\item[{uint8\+\_\+t}]{pwm\+\_\+pin }\end{DoxyParamCaption})}

Alternate Constructor which can call your own function to map the DC motor to arduino port, it will assigned the output pin. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em dc\+\_\+dir\+\_\+h1} & -\/ arduino port for direction pin1 \\
\hline
\mbox{\texttt{ in}}  & {\em dc\+\_\+dir\+\_\+h2} & -\/ arduino port for direction pin2 \\
\hline
\mbox{\texttt{ in}}  & {\em pwm\+\_\+pin} & -\/ arduino port for pwm input(should analog pin) \\
\hline
\end{DoxyParams}


\doxysubsection{Member Function Documentation}
\Hypertarget{class_me_mega_pi_d_c_motor_a01f48a77e9fac7dcda0bba9dea5752aa}\label{class_me_mega_pi_d_c_motor_a01f48a77e9fac7dcda0bba9dea5752aa} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!reset@{reset}}
\index{reset@{reset}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{reset()}{reset()}}
{\footnotesize\ttfamily void Me\+Mega\+Pi\+DCMotor\+::reset (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{port }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
setpin 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Reset the DC motor available PIN by megapi port. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em port} & -\/ megapi dc port from PORT\+\_\+1 to PORT\+\_\+12 \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\begin{DoxyParagraph}{Others}
None
\end{DoxyParagraph}
\begin{DoxyParagraph}{Function}
reset 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Reset the DC motor available PIN by megapi port. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em port} & -\/ megapi dc port from PORT\+\_\+1 to PORT\+\_\+12 \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_mega_pi_d_c_motor_ac324a1423bf3c3ed73e5df7ea9b2b92a}\label{class_me_mega_pi_d_c_motor_ac324a1423bf3c3ed73e5df7ea9b2b92a} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!run@{run}}
\index{run@{run}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{run()}{run()}}
{\footnotesize\ttfamily void Me\+Mega\+Pi\+DCMotor\+::run (\begin{DoxyParamCaption}\item[{int16\+\_\+t}]{speed }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
run 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Control the motor forward or reverse 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em speed} & -\/ Speed value from -\/255 to 255 \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_mega_pi_d_c_motor_a8d46dbfbce3b5f38622eb6f3febd4feb}\label{class_me_mega_pi_d_c_motor_a8d46dbfbce3b5f38622eb6f3febd4feb} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!setpin@{setpin}}
\index{setpin@{setpin}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{setpin()}{setpin()}}
{\footnotesize\ttfamily void Me\+Mega\+Pi\+DCMotor\+::setpin (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{dc\+\_\+dir\+\_\+h1,  }\item[{uint8\+\_\+t}]{dc\+\_\+dir\+\_\+h2,  }\item[{uint8\+\_\+t}]{pwm\+\_\+pin }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
setpin 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Reset the DC motor available PIN by its arduino port. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em dc\+\_\+dir\+\_\+h1} & -\/ arduino port for direction pin1 \\
\hline
\mbox{\texttt{ in}}  & {\em dc\+\_\+dir\+\_\+h2} & -\/ arduino port for direction pin2 \\
\hline
\mbox{\texttt{ in}}  & {\em pwm\+\_\+pin} & -\/ arduino port for pwm input(should analog pin) \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_mega_pi_d_c_motor_a1df48e25908553976462a4d0e4413eda}\label{class_me_mega_pi_d_c_motor_a1df48e25908553976462a4d0e4413eda} 
\index{MeMegaPiDCMotor@{MeMegaPiDCMotor}!stop@{stop}}
\index{stop@{stop}!MeMegaPiDCMotor@{MeMegaPiDCMotor}}
\doxysubsubsection{\texorpdfstring{stop()}{stop()}}
{\footnotesize\ttfamily void Me\+Mega\+Pi\+DCMotor\+::stop (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
stop 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Stop the rotation of the motor 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
src/\mbox{\hyperlink{_me_mega_pi_d_c_motor_8h}{Me\+Mega\+Pi\+DCMotor.\+h}}\item 
src/\mbox{\hyperlink{_me_mega_pi_d_c_motor_8cpp}{Me\+Mega\+Pi\+DCMotor.\+cpp}}\end{DoxyCompactItemize}
