99 lines
4.1 KiB
TeX
99 lines
4.1 KiB
TeX
\hypertarget{group__lowerlevelfun}{}\section{Lower level fun stuff methods}
|
|
\label{group__lowerlevelfun}\index{Lower level fun stuff methods@{Lower level fun stuff methods}}
|
|
\subsection*{Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
void \hyperlink{group__lowerlevelfun_ga04309a38252639a8eaa43809c04c11c8}{Code\+Racer\+::look\+\_\+around} ()
|
|
\begin{DoxyCompactList}\small\item\em Fun stuff -\/ will move the servo around after a random amount of time. \end{DoxyCompactList}\item
|
|
void \hyperlink{group__lowerlevelfun_ga3b6f819fb82d910888fbc87abff1470c}{Code\+Racer\+::kitt} ()
|
|
\begin{DoxyCompactList}\small\item\em Fun stuff -\/ you know Knightrider... \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
|
|
|
|
\subsection{Detailed Description}
|
|
|
|
|
|
\subsection{Function Documentation}
|
|
\mbox{\Hypertarget{group__lowerlevelfun_ga04309a38252639a8eaa43809c04c11c8}\label{group__lowerlevelfun_ga04309a38252639a8eaa43809c04c11c8}}
|
|
\index{Lower level fun stuff methods@{Lower level fun stuff methods}!look\+\_\+around@{look\+\_\+around}}
|
|
\index{look\+\_\+around@{look\+\_\+around}!Lower level fun stuff methods@{Lower level fun stuff methods}}
|
|
\subsubsection{\texorpdfstring{look\+\_\+around()}{look\_around()}}
|
|
{\footnotesize\ttfamily void Code\+Racer\+::look\+\_\+around (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
|
|
|
|
|
|
|
|
Fun stuff -\/ will move the servo around after a random amount of time.
|
|
|
|
\begin{DoxyReturn}{Returns}
|
|
nothing
|
|
\end{DoxyReturn}
|
|
|
|
|
|
Definition at line 440 of file Code\+Racer.\+cpp.
|
|
|
|
|
|
\begin{DoxyCode}
|
|
441 \{
|
|
442 \textcolor{keywordflow}{if} (\_servo\_look\_around\_at\_ms < millis()) \{
|
|
443 \_servo\_look\_around\_at\_ms = millis() + random(FUN\_MIN\_PAUSE\_MS, FUN\_MAX\_PAUSE\_MS);
|
|
444 servo\_set\_to\_left();
|
|
445 delay(500);
|
|
446 servo\_set\_to\_right();
|
|
447 delay(800);
|
|
448 servo\_set\_to\_center();
|
|
449 delay(300);
|
|
450 servo\_set\_to\_left();
|
|
451 delay(100);
|
|
452 servo\_set\_to\_center();
|
|
453 \}
|
|
454 \}
|
|
\end{DoxyCode}
|
|
\mbox{\Hypertarget{group__lowerlevelfun_ga3b6f819fb82d910888fbc87abff1470c}\label{group__lowerlevelfun_ga3b6f819fb82d910888fbc87abff1470c}}
|
|
\index{Lower level fun stuff methods@{Lower level fun stuff methods}!kitt@{kitt}}
|
|
\index{kitt@{kitt}!Lower level fun stuff methods@{Lower level fun stuff methods}}
|
|
\subsubsection{\texorpdfstring{kitt()}{kitt()}}
|
|
{\footnotesize\ttfamily void Code\+Racer\+::kitt (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
|
|
|
|
|
|
|
|
Fun stuff -\/ you know Knightrider...
|
|
|
|
\begin{DoxyReturn}{Returns}
|
|
nothing
|
|
\end{DoxyReturn}
|
|
|
|
|
|
Definition at line 459 of file Code\+Racer.\+cpp.
|
|
|
|
|
|
\begin{DoxyCode}
|
|
460 \{
|
|
461 \textcolor{keywordflow}{if} (millis() - \_last\_led\_switched\_at\_ms > LED\_SWITCH\_MS) \{
|
|
462 \_last\_led\_switched\_at\_ms = millis();
|
|
463 \textcolor{keywordflow}{if} (\_last\_led\_on >= 5) \{
|
|
464 \_led\_count = -1;
|
|
465 \}
|
|
466 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\_last\_led\_on <= 0) \{
|
|
467 \_led\_count = 1;
|
|
468 \}
|
|
469 \_last\_led\_on = \_last\_led\_on + \_led\_count;
|
|
470 \textcolor{keywordflow}{switch} (\_last\_led\_on) \{
|
|
471 \textcolor{keywordflow}{case} 0:
|
|
472 set\_leds\_left\_stop\_frwd\_right(LEDON, LEDOFF, LEDOFF, LEDOFF);
|
|
473 \textcolor{keywordflow}{break};
|
|
474 \textcolor{keywordflow}{case} 1:
|
|
475 set\_leds\_left\_stop\_frwd\_right(LEDON, LEDOFF, LEDOFF, LEDOFF);
|
|
476 \textcolor{keywordflow}{break};
|
|
477 \textcolor{keywordflow}{case} 2:
|
|
478 set\_leds\_left\_stop\_frwd\_right(LEDOFF, LEDON, LEDOFF, LEDOFF);
|
|
479 \textcolor{keywordflow}{break};
|
|
480 \textcolor{keywordflow}{case} 3:
|
|
481 set\_leds\_left\_stop\_frwd\_right(LEDOFF, LEDOFF, LEDON, LEDOFF);
|
|
482 \textcolor{keywordflow}{break};
|
|
483 \textcolor{keywordflow}{case} 4:
|
|
484 \textcolor{keywordflow}{case} 5:
|
|
485 set\_leds\_left\_stop\_frwd\_right(LEDOFF, LEDOFF, LEDOFF, LEDON);
|
|
486 \textcolor{keywordflow}{break};
|
|
487 \}
|
|
488 \}
|
|
489 \}
|
|
\end{DoxyCode}
|