\doxysection{Me\+Encoder\+Motor Class Reference}
\hypertarget{class_me_encoder_motor}{}\label{class_me_encoder_motor}\index{MeEncoderMotor@{MeEncoderMotor}}


Class for Encoder Motor Driver.  




{\ttfamily \#include $<$src/\+Me\+Encoder\+Motor.\+h$>$}



Inheritance diagram for Me\+Encoder\+Motor\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=170pt]{class_me_encoder_motor__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Me\+Encoder\+Motor\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=170pt]{class_me_encoder_motor__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_me_encoder_motor_ac1e1d1667620217d906460831316ca26}{Me\+Encoder\+Motor}} (uint8\+\_\+t addr, uint8\+\_\+t slot)
\item 
\mbox{\hyperlink{class_me_encoder_motor_a28ce79300600255bef5420094199cf5a}{Me\+Encoder\+Motor}} (uint8\+\_\+t slot)
\item 
\mbox{\hyperlink{class_me_encoder_motor_acbeab97d3d90a0854155264ddfd1d7bb}{Me\+Encoder\+Motor}} ()
\item 
void \mbox{\hyperlink{class_me_encoder_motor_aeda692228687464c10a47f279b682d53}{begin}} ()
\item 
boolean \mbox{\hyperlink{class_me_encoder_motor_a83b974e7a06af62d268bd251cc118509}{reset}} ()
\item 
boolean \mbox{\hyperlink{class_me_encoder_motor_a10a88a426631d9251a0db96f921f1bcd}{move}} (float angle, float speed)
\item 
boolean \mbox{\hyperlink{class_me_encoder_motor_a05f1de71458b1ab75bd34f9c948cc463}{move\+To}} (float angle, float speed)
\item 
boolean \mbox{\hyperlink{class_me_encoder_motor_a94231a437d93fe7681fa41024207a28e}{run\+Turns}} (float turns, float speed)
\item 
boolean \mbox{\hyperlink{class_me_encoder_motor_aff4c3a4f790b712a36fff5184927af00}{run\+Speed}} (float speed)
\item 
boolean \mbox{\hyperlink{class_me_encoder_motor_adc48a3b9f3508aa50b80d00e7fdce178}{run\+Speed\+And\+Time}} (float speed, float time)
\item 
float \mbox{\hyperlink{class_me_encoder_motor_a7ff4246627c94976d97141da3a31ad00}{get\+Current\+Speed}} ()
\item 
float \mbox{\hyperlink{class_me_encoder_motor_a3e0f684f694a4ace231ac8fe90c68c62}{get\+Current\+Position}} ()
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_me_port}{Me\+Port}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_me_port_ae4b9e8e718b626d0ce4017a430878210}{Me\+Port}} (void)
\item 
\mbox{\hyperlink{class_me_port_a7a1d7cdf061740148cd893ba481420a3}{Me\+Port}} (uint8\+\_\+t port)
\item 
\mbox{\hyperlink{class_me_port_a1458b606f98da409d7ab4fa7d09c6816}{Me\+Port}} (uint8\+\_\+t port, uint8\+\_\+t slot)
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a8d9ca22e35477573b27c4165ac61def0}{get\+Port}} (void)
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a4c73dec349340e958b9567b06fa6f27c}{get\+Slot}} (void)
\item 
bool \mbox{\hyperlink{class_me_port_a8b7b990f5fa85dfc28f7f3d0d7ba46b9}{d\+Read1}} (uint8\+\_\+t mode=INPUT)
\item 
bool \mbox{\hyperlink{class_me_port_ab4fd13565335bd781da8f44bae803031}{d\+Read2}} (uint8\+\_\+t mode=INPUT)
\item 
bool \mbox{\hyperlink{class_me_port_aabcb0e1dc89942cf302b8cbac2cbd0a5}{dp\+Read1}} (void)
\item 
bool \mbox{\hyperlink{class_me_port_a2e4b6faf3e9494e819ccee47dfb8010e}{dp\+Read2}} (void)
\item 
void \mbox{\hyperlink{class_me_port_a9d5f60427202c26bc8da4b1e6a66c5c2}{d\+Write1}} (bool value)
\item 
void \mbox{\hyperlink{class_me_port_a0d9ee041f8361f45bcc83bed9577415f}{d\+Write2}} (bool value)
\item 
int16\+\_\+t \mbox{\hyperlink{class_me_port_acfd28b1ab8cc6af5bf8223446022525c}{a\+Read1}} (void)
\item 
int16\+\_\+t \mbox{\hyperlink{class_me_port_a63709dcbe9850c0d3baec1fed72809bf}{a\+Read2}} (void)
\item 
void \mbox{\hyperlink{class_me_port_adb4d7959f2059bf9986a8e5a631988ae}{a\+Write1}} (int16\+\_\+t value)
\item 
void \mbox{\hyperlink{class_me_port_a3834f0f30618ec31789d524dd367e44f}{a\+Write2}} (int16\+\_\+t value)
\item 
void \mbox{\hyperlink{class_me_port_a7b82ce913d98ecff906569d795073892}{reset}} (uint8\+\_\+t port)
\item 
void \mbox{\hyperlink{class_me_port_a91e3cca62e5f8fffead56f8104488d4d}{reset}} (uint8\+\_\+t port, uint8\+\_\+t slot)
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a1ed16a0f863a618cc9f32b27015107e7}{pin1}} (void)
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a8a1b3cd06dffbb48d40c3adf25011803}{pin2}} (void)
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_aea7dad0142d940c0395b1782fe5adeae}{pin}} (void)
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a637d42b5a62d655b8517bc8a363206f3}{pin}} (uint8\+\_\+t port, uint8\+\_\+t slot)
\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Protected Attributes inherited from \mbox{\hyperlink{class_me_port}{Me\+Port}}}
\begin{DoxyCompactItemize}
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_ab5295b9e84ecedf3f93ab47cf8f10284}{s1}}
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a6c09cece23372a6ab340512a0db3e37d}{s2}}
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_adc9cdd4e574061d41244fc662974544f}{\+\_\+port}}
\item 
uint8\+\_\+t \mbox{\hyperlink{class_me_port_a4159543b593b047cd82fedab30b178b7}{\+\_\+slot}}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Class for Encoder Motor Driver. 

Driver for Me Encoder Motor module.

Driver for Encoder Motor module.

\begin{DoxyParagraph}{Copyright (C), 2012-\/2016, Make\+Block}

\end{DoxyParagraph}


\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{class_me_encoder_motor_ac1e1d1667620217d906460831316ca26}\label{class_me_encoder_motor_ac1e1d1667620217d906460831316ca26} 
\index{MeEncoderMotor@{MeEncoderMotor}!MeEncoderMotor@{MeEncoderMotor}}
\index{MeEncoderMotor@{MeEncoderMotor}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{MeEncoderMotor()}{MeEncoderMotor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily Me\+Encoder\+Motor\+::\+Me\+Encoder\+Motor (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{addr,  }\item[{uint8\+\_\+t}]{slot }\end{DoxyParamCaption})}

Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you can set any slot for the Encoder Motor device. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em port} & -\/ RJ25 port from PORT\+\_\+1 to M2 \\
\hline
\mbox{\texttt{ in}}  & {\em slot} & -\/ SLOT1 or SLOT2 \\
\hline
\end{DoxyParams}
\Hypertarget{class_me_encoder_motor_a28ce79300600255bef5420094199cf5a}\label{class_me_encoder_motor_a28ce79300600255bef5420094199cf5a} 
\index{MeEncoderMotor@{MeEncoderMotor}!MeEncoderMotor@{MeEncoderMotor}}
\index{MeEncoderMotor@{MeEncoderMotor}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{MeEncoderMotor()}{MeEncoderMotor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily Me\+Encoder\+Motor\+::\+Me\+Encoder\+Motor (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{slot }\end{DoxyParamCaption})}

Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you can set any slot for the Encoder Motor device. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em slot} & -\/ SLOT1 or SLOT2 \\
\hline
\end{DoxyParams}
\Hypertarget{class_me_encoder_motor_acbeab97d3d90a0854155264ddfd1d7bb}\label{class_me_encoder_motor_acbeab97d3d90a0854155264ddfd1d7bb} 
\index{MeEncoderMotor@{MeEncoderMotor}!MeEncoderMotor@{MeEncoderMotor}}
\index{MeEncoderMotor@{MeEncoderMotor}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{MeEncoderMotor()}{MeEncoderMotor()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily Me\+Encoder\+Motor\+::\+Me\+Encoder\+Motor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you should initialized slot and slave\+Address here for the Encoder Motor device. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em None} & \\
\hline
\end{DoxyParams}


\doxysubsection{Member Function Documentation}
\Hypertarget{class_me_encoder_motor_aeda692228687464c10a47f279b682d53}\label{class_me_encoder_motor_aeda692228687464c10a47f279b682d53} 
\index{MeEncoderMotor@{MeEncoderMotor}!begin@{begin}}
\index{begin@{begin}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{begin()}{begin()}}
{\footnotesize\ttfamily void Me\+Encoder\+Motor\+::begin (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
begin 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Initialize Encoder Motor. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em None} & \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_a3e0f684f694a4ace231ac8fe90c68c62}\label{class_me_encoder_motor_a3e0f684f694a4ace231ac8fe90c68c62} 
\index{MeEncoderMotor@{MeEncoderMotor}!getCurrentPosition@{getCurrentPosition}}
\index{getCurrentPosition@{getCurrentPosition}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{getCurrentPosition()}{getCurrentPosition()}}
{\footnotesize\ttfamily float Me\+Encoder\+Motor\+::get\+Current\+Position (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
get\+Current\+Position 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
The current position of Motor. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em None} & \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_a7ff4246627c94976d97141da3a31ad00}\label{class_me_encoder_motor_a7ff4246627c94976d97141da3a31ad00} 
\index{MeEncoderMotor@{MeEncoderMotor}!getCurrentSpeed@{getCurrentSpeed}}
\index{getCurrentSpeed@{getCurrentSpeed}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{getCurrentSpeed()}{getCurrentSpeed()}}
{\footnotesize\ttfamily float Me\+Encoder\+Motor\+::get\+Current\+Speed (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
get\+Current\+Speed 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
The current speed of Motor\textquotesingle{}s movement. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em None} & \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_a10a88a426631d9251a0db96f921f1bcd}\label{class_me_encoder_motor_a10a88a426631d9251a0db96f921f1bcd} 
\index{MeEncoderMotor@{MeEncoderMotor}!move@{move}}
\index{move@{move}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{move()}{move()}}
{\footnotesize\ttfamily boolean Me\+Encoder\+Motor\+::move (\begin{DoxyParamCaption}\item[{float}]{angle,  }\item[{float}]{speed }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
move 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Motor move. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em angle} & -\/ The angle move of Motor. \\
\hline
\mbox{\texttt{ in}}  & {\em speed} & -\/ The speed move of Motor. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
Return the result of Motor\textquotesingle{}s movement. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_a05f1de71458b1ab75bd34f9c948cc463}\label{class_me_encoder_motor_a05f1de71458b1ab75bd34f9c948cc463} 
\index{MeEncoderMotor@{MeEncoderMotor}!moveTo@{moveTo}}
\index{moveTo@{moveTo}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{moveTo()}{moveTo()}}
{\footnotesize\ttfamily boolean Me\+Encoder\+Motor\+::move\+To (\begin{DoxyParamCaption}\item[{float}]{angle,  }\item[{float}]{speed }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
move\+To 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Motor move to the aim. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em angle} & -\/ The angle move of Motor. \\
\hline
\mbox{\texttt{ in}}  & {\em speed} & -\/ The speed move of Motor. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
Return the result of Motor\textquotesingle{}s movement to the aim. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_a83b974e7a06af62d268bd251cc118509}\label{class_me_encoder_motor_a83b974e7a06af62d268bd251cc118509} 
\index{MeEncoderMotor@{MeEncoderMotor}!reset@{reset}}
\index{reset@{reset}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{reset()}{reset()}}
{\footnotesize\ttfamily boolean Me\+Encoder\+Motor\+::reset (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
reset 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Reset the available data for Encoder Motor. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em None} & \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_aff4c3a4f790b712a36fff5184927af00}\label{class_me_encoder_motor_aff4c3a4f790b712a36fff5184927af00} 
\index{MeEncoderMotor@{MeEncoderMotor}!runSpeed@{runSpeed}}
\index{runSpeed@{runSpeed}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{runSpeed()}{runSpeed()}}
{\footnotesize\ttfamily boolean Me\+Encoder\+Motor\+::run\+Speed (\begin{DoxyParamCaption}\item[{float}]{speed }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
run\+Speed 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
The speed of Motor\textquotesingle{}s movement. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em speed} & -\/ The speed move of Motor. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
Return 0. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_adc48a3b9f3508aa50b80d00e7fdce178}\label{class_me_encoder_motor_adc48a3b9f3508aa50b80d00e7fdce178} 
\index{MeEncoderMotor@{MeEncoderMotor}!runSpeedAndTime@{runSpeedAndTime}}
\index{runSpeedAndTime@{runSpeedAndTime}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{runSpeedAndTime()}{runSpeedAndTime()}}
{\footnotesize\ttfamily boolean Me\+Encoder\+Motor\+::run\+Speed\+And\+Time (\begin{DoxyParamCaption}\item[{float}]{speed,  }\item[{float}]{time }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
run\+Speed\+And\+Time 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
The speed and time of Motor\textquotesingle{}s movement. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em speed} & -\/ The speed move of Motor. \\
\hline
\mbox{\texttt{ in}}  & {\em time} & -\/ The time move of Motor. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
Return the result of Motor\textquotesingle{}s movement. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}
\Hypertarget{class_me_encoder_motor_a94231a437d93fe7681fa41024207a28e}\label{class_me_encoder_motor_a94231a437d93fe7681fa41024207a28e} 
\index{MeEncoderMotor@{MeEncoderMotor}!runTurns@{runTurns}}
\index{runTurns@{runTurns}!MeEncoderMotor@{MeEncoderMotor}}
\doxysubsubsection{\texorpdfstring{runTurns()}{runTurns()}}
{\footnotesize\ttfamily boolean Me\+Encoder\+Motor\+::run\+Turns (\begin{DoxyParamCaption}\item[{float}]{turns,  }\item[{float}]{speed }\end{DoxyParamCaption})}

\begin{DoxyParagraph}{Function}
run\+Turns 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Description}
Motor move turns. 
\end{DoxyParagraph}

\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em turns} & -\/ The turns move of Motor. \\
\hline
\mbox{\texttt{ in}}  & {\em speed} & -\/ The speed move of Motor. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Output}
None 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Return}
Return the result of Motor\textquotesingle{}s movement. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{Others}
None 
\end{DoxyParagraph}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
src/\mbox{\hyperlink{_me_encoder_motor_8h}{Me\+Encoder\+Motor.\+h}}\item 
src/\mbox{\hyperlink{_me_encoder_motor_8cpp}{Me\+Encoder\+Motor.\+cpp}}\end{DoxyCompactItemize}
