\hypertarget{_myro_c_8h}{}\section{Myro\+C.\+h File Reference}
\label{_myro_c_8h}\index{Myro\+C.\+h@{Myro\+C.\+h}}


Header for a C-\/based, my-\/robot package for the Scribbler 2.  


This graph shows which files directly or indirectly include this file\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=179pt]{_myro_c_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{struct_pixel}{Pixel}
\begin{DoxyCompactList}\small\item\em Struct for a pixel. \end{DoxyCompactList}\item 
struct \hyperlink{struct_picture}{Picture}
\begin{DoxyCompactList}\small\item\em Struct for a picture object. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{_myro_c_8h_a41f98daf605f63266a77c9b50fabffce}\label{_myro_c_8h_a41f98daf605f63266a77c9b50fabffce}} 
\#define {\bfseries R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE}~int
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE \hyperlink{_myro_c_8h_a43e7883a15adb7080aa331b0fb0a5965}{r\+Connect} (const char $\ast$address)
\begin{DoxyCompactList}\small\item\em connects program to Scribbler \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a169e562028db3fcbbe8ab6a35476bbb8}{r\+Disconnect} ()
\begin{DoxyCompactList}\small\item\em stop Scribbler motion and close Bluetooth \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a0bb37dac7cc80ce6c858f5de88efc9fe}{r\+Set\+Connection} (R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE new\+\_\+socket\+\_\+num)
\begin{DoxyCompactList}\small\item\em set current connection to the socket number \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a129a75b1d9629beca5da09688f239c0f}{r\+Finish\+Processing} ()
\begin{DoxyCompactList}\small\item\em all timed motions/image displays completed, all robots stopped, and all robot Bluetooth connections closed \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a93bc73071c06f3d81c843124f5308368}{r\+Set\+Volume} (char high\+Mute)
\begin{DoxyCompactList}\small\item\em Set sound to high volume (H) or mute (M)  high\+Mute set volume of Scribbler. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_aa46e349ecd38fc90f8d7cea9bb8678d6}{r\+Beep} (double duration, int frequency)
\begin{DoxyCompactList}\small\item\em Beeps with the given duration and frequency. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a37ccc278b3ecca6290debf1929d1e479}{r\+Beep2} (double duration, int freq1, int freq2)
\begin{DoxyCompactList}\small\item\em Generates two notes for the prescribed duration. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_ab6f8b6b28334162e70f7cf3a3b165e4b}{r\+Set\+Name} (const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Change name stored in the robot to the 16-\/byte name given. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{_myro_c_8h_ab3e6bd45aea018d47bf98348c1315483}{r\+Get\+Name} ()
\begin{DoxyCompactList}\small\item\em Get the name of the robot. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a3753b86dcb4de002e8456501ca35edae}{r\+Set\+Forwardness} (char $\ast$direction)
\begin{DoxyCompactList}\small\item\em specifies which end of the Scribbler is considered the front \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a9e21fdea3dffc9e336739c8e7d455b59}{r\+Set\+Forwardness\+Txt} (char $\ast$direction)
\begin{DoxyCompactList}\small\item\em alternative to r\+Set\+Forwardness for compatibility with earlier MyroC \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{_myro_c_8h_a07e585491ba7af9e13779f9e3db6fd31}{r\+Get\+Forwardness} ()
\begin{DoxyCompactList}\small\item\em Gets the forwardness of the Scribbler. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a21581ded1f409300e8f63f4c41c2f2f0}{r\+Set\+L\+E\+D\+Front} (int led)
\begin{DoxyCompactList}\small\item\em Set the front \mbox{[}fluke\mbox{]} L\+ED on or off. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a2466176fa2332b88e5013d6b3fe9ceb8}{r\+Set\+L\+E\+D\+Back} (double led)
\begin{DoxyCompactList}\small\item\em Set the the intensity of the back fluke L\+ED. \end{DoxyCompactList}\item 
double \hyperlink{_myro_c_8h_a80896cdb3ff63acd1fa0a5ce97ba7c9d}{r\+Get\+Battery} ()
\begin{DoxyCompactList}\small\item\em Get the current voltage from the Scribbler batteries; Maximum charge from 6 batteries could be up to 6 volts; Manufacturer suggests batteries should be changed below 4.\+1 volts. \end{DoxyCompactList}\item 
int \hyperlink{_myro_c_8h_a9296f6acbac4ef59cfc6cb0dc535c60f}{r\+Get\+Stall} (int sample\+Size)
\item 
void \hyperlink{_myro_c_8h_ac7c83fef113af1c3612ce59c03417e8b}{r\+Set\+Bluetooth\+Echo} (char on\+Off)
\begin{DoxyCompactList}\small\item\em Turn on and off the printing transmission and echong of Bluetooth transmissions All robot commands involve the transmission of a command over Bluetooth Scribbler commands are always 9 bytes ~\newline
 Fluke commands have varying lengths ~\newline
The fluke echos most, but not all, of the commands ~\newline
For many commands, the fluke also echos 11 bytes of sensor data. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a9006ba8c581c7543d7d460d76c06d077}{r\+Get\+Lights\+All} (int light\+Sensors\mbox{[}3\mbox{]}, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Get the average values of each of the three light sensors in an array. Values of each light sensor can somewhat (typically under 5\%-\/10\%). To even out variability, the sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
int \hyperlink{_myro_c_8h_aaba34be55fd5db7d8c1ed08ea7caa6c2}{r\+Get\+Light\+Txt} (const char $\ast$sensor\+Name, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Get the average values of a specified light sensor. Values of each light sensor can somewhat (typically under 5\%-\/10\%). To even out variability, the sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_ab4bf6868424a63a95a85decea8a93fc2}{r\+Get\+I\+R\+All} (int ir\+Sensors\mbox{[}2\mbox{]}, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Get an array of true/false values regarding the presence of obstacle based on the average values of each of the three IR sensors. Since readings of each light sensor can vary substantially, each sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
int \hyperlink{_myro_c_8h_afdf7579ce632c07de1d90f27d67abff7}{r\+Get\+I\+R\+Txt} (const char $\ast$sensor\+Name, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Use specified IR sensor to determine if obstacle is present. Since values of each light sensor can vary substantially, the sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a7fc13d53088ba239a95c99b46b9607e8}{r\+Get\+Line} (int line\+Sensors\mbox{[}2\mbox{]}, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Use Scribbler 2 line sensors of Scribbler to check for a black line on a white surface under the robot. Since values of each light sensor can vary substantially, the sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_ab319898f4ab7d48f15e1215db8e5b4ba}{r\+Set\+I\+R\+Power} (int power)
\begin{DoxyCompactList}\small\item\em Set the amount of power for the dongle\textquotesingle{}s IR sensors. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a3a47f1f85c9fa6d68b5ebd8c0ad2e484}{r\+Get\+Obstacle\+All} (int obst\+Sensors\mbox{[}3\mbox{]}, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Get the average values of the three obstacle sensors in an array. Since readings of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), each sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
int \hyperlink{_myro_c_8h_a5853bf9f106b47ed0e767adf8fab0d0b}{r\+Get\+Obstacle\+Txt} (const char $\ast$sensor\+Name, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Get the average values of a specified obstacle (IR) sensor. Since values of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), the sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a98820d670fcacb6780e68a58a4bc0a8a}{r\+Get\+Bright\+All} (int bright\+Sensors\mbox{[}3\mbox{]}, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Read the Fluke\textquotesingle{}s virtual light sensors. Since readings of each brightness sensor can vary substantially (successive readings may differ by 5000-\/10000), each sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
int \hyperlink{_myro_c_8h_a6c898c1c12957822fbd0e2b68f573c4d}{r\+Get\+Bright\+Txt} (char $\ast$sensor\+Name, int sample\+Size)
\begin{DoxyCompactList}\small\item\em Reads one of the Fluke\textquotesingle{}s virtual light sensors. Each sensor reports a total intensity in the left, middle, or right of the Fluke\textquotesingle{}s camera Since values of each obstacle sensor can vary substantially (successive readings may differ by 5000-\/10000), the sensor can be queried sample\+Size times and an average obtained. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a1e10a9735a4b8dc8c79100905c30ecab}{r\+Get\+Info} (char $\ast$info\+Buffer)
\begin{DoxyCompactList}\small\item\em returns information about the robot\textquotesingle{}s dongle, firmware, and communication mode as a 60 character array in info\+Buffer. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a1b2462eb7a3149a89cfe73f39339ed89}{r\+Turn\+Left} (double speed, double time)
\begin{DoxyCompactList}\small\item\em turn Scribbler left for a specified time and speed \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a0c3496dd17992e9788110c15c017e566}{r\+Turn\+Right} (double speed, double time)
\begin{DoxyCompactList}\small\item\em turn Scribbler right for a specified time and speed \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_aa1a97cc92ee785afb8af4e248d08cbb9}{r\+Turn\+Speed} (char $\ast$direction, double speed, double time)
\begin{DoxyCompactList}\small\item\em turn Scribbler in direction for a specified time and speed \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_aaf2b57e29c053c7e3901ec5ee3cb047d}{r\+Forward} (double speed, double time)
\begin{DoxyCompactList}\small\item\em moves Scribbler forward for a specified time and speed \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_af55f107794f40ee2f77dd6817ad1453f}{r\+Fast\+Forward} (double time)
\begin{DoxyCompactList}\small\item\em moves Scribbler forward at the largest possible speed for a specified time \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_aa5544de8b24ee7917bcb1ba695071459}{r\+Backward} (double speed, double time)
\begin{DoxyCompactList}\small\item\em moves Scribbler backward for a specified time and speed \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a6712dd6e8442e19ff28158adeaf7c0d0}{r\+Motors} (double left\+Speed, double right\+Speed)
\begin{DoxyCompactList}\small\item\em move robot with given speeds for the left and right motors continues until given another motion command or disconnected (non-\/blocking) \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_ac561c993b092a153091bb20d2e4aca45}{r\+Stop} ()
\begin{DoxyCompactList}\small\item\em directs robot to stop movement \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_ae0c1a7d7ba14f6efb8df0db1f4bc08b9}{r\+Hard\+Stop} ()
\begin{DoxyCompactList}\small\item\em cuts power to the motor of the robot \end{DoxyCompactList}\item 
\hyperlink{struct_picture}{Picture} \hyperlink{_myro_c_8h_a4e10733a73b58955046a5cf2252117a0}{r\+Take\+Picture} ()
\begin{DoxyCompactList}\small\item\em Use the camera to take a photo. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_ace59c91f90d0bd811b3df1d3ddcf14e3}{r\+Save\+Picture} (\hyperlink{struct_picture}{Picture} $\ast$pic, char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Save a \hyperlink{struct_picture}{Picture} to a .jpeg. \end{DoxyCompactList}\item 
\hyperlink{struct_picture}{Picture} \hyperlink{_myro_c_8h_a22bed206f3ae7563a116be255e91906e}{r\+Load\+Picture} (char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Load a picture from a .jpeg file. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a9744b74cb416f7820f319e3bd349b07d}{r\+Display\+Picture} (\hyperlink{struct_picture}{Picture} $\ast$pic, double duration, const char $\ast$window\+Title)
\begin{DoxyCompactList}\small\item\em Display a picture in a new window. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a7e5e4188b912328a1c357b534431c2ff}{r\+Display\+Image\+Processing\+Errors} ()
\begin{DoxyCompactList}\small\item\em Turn on and off the printing of error messasge for image processing. \end{DoxyCompactList}\item 
void \hyperlink{_myro_c_8h_a820ec009f1e2a6b8cf701301f79107a5}{r\+Wait\+Timed\+Image\+Display} ()
\begin{DoxyCompactList}\small\item\em Wait until all timed, non-\/blocking image window timers are complete. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Header for a C-\/based, my-\/robot package for the Scribbler 2. 

Revision History

Version 1.\+0 based on a C++ package by April O\textquotesingle{}Neill, David Cowden, Dilan Ustek, Erik Opavsky, and Henry M. Walker

Developers of the C package for Linux\+: Creators Version 2.\+0 (C functions for utilities,general,sensors,movement)\+: Spencer Liberto Dilan Ustek Jordan Yuan Henry M. Walker Contributors Version 2.\+2-\/2.\+3\+: (C functions for image processing) Anita De\+Witt Jason Liu Nick Knoebber Vasilisa Bashlovkina Revision for Version 2.\+4\+: (image row/column made to match matrix notation) Henry M. Walker

Revisions for Version 3.\+0 Henry M. Walker

C ported to Macintosh Linux/\+Mac differences required for connections — otherwise same code Open\+GL used to display images, replacing Image\+Magick same \mbox{[}new\mbox{]} code used for both Linux and Macintosh 1 process for robot control 1 process needed for each titled window (not each image, as in 2.\+2-\/2.\+4) Blocking options (negative duration parameter) utilize separate thread timer MyroC implementation files organized by user function as follows\+:

Revisions for Version 3.\+1 Henry M. Walker

\hyperlink{struct_picture}{Picture} struct and image functions revised to allow 192 by 256 images from origial Fluke camera 266 x 427 low-\/resolution images from Fluke 2 (high-\/resolution (800 x 1280) too large for more than 2-\/4 variables on run-\/time stack) storage, retrieval, and display of any images up to 266 x 427

Revisions for Version 3.\+2 Henry M. Walker

Practical range of r\+Beep duration identified as $<$= 3.\+0014 seconds Image display and processing resolves several matters and adds functionality function r\+Display\+Picture completely rewritten over time Open\+GL rountines had encountered troubles on Linux, specifically glut\+Hide\+Window() hid images, but could not be restored, with difficulties depending on the graphics card on Mac, High Sierra generated compile warnings and restricted threads that could display images function r\+Display\+Image\+Processing\+Errors added function r\+Wait\+Timed\+Image\+Display updated substantially

Revisions for Version 3.\+3 Henry M. Walker

MyroC ported to Windows 10, in addition to Linux and Mac OS X Additional refinements text parameter for r\+Get\+Light\+Txt expanded to \char`\"{}\+Middle\char`\"{} as well as \char`\"{}\+Center\char`\"{}

This program and all MyroC software is licensed under the Creative Commons Attribution-\/\+Noncommercial-\/\+Share Alike 3.\+0 United States License. Details may be found at \href{http://creativecommons.org/licenses/by-nc-sa/3.0/us/}{\tt http\+://creativecommons.\+org/licenses/by-\/nc-\/sa/3.\+0/us/} 

\subsection{Function Documentation}
\mbox{\Hypertarget{_myro_c_8h_aa5544de8b24ee7917bcb1ba695071459}\label{_myro_c_8h_aa5544de8b24ee7917bcb1ba695071459}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Backward@{r\+Backward}}
\index{r\+Backward@{r\+Backward}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Backward()}{rBackward()}}
{\footnotesize\ttfamily void r\+Backward (\begin{DoxyParamCaption}\item[{double}]{speed,  }\item[{double}]{time }\end{DoxyParamCaption})}



moves Scribbler backward for a specified time and speed 


\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move backward ~\newline
 linear range\+: -\/1.\+0 specifies move forward at full speed ~\newline
 0.\+0 specifies no forward/backward movement ~\newline
 1.\+0 specifies move backward at full speed \\
\hline
{\em time} & specifies the duration of the turn ~\newline
 if negative\+: the robot starts backward (non-\/blocking) other processing proceeds, and the robot continues backward until given another motion command or disconnected (non-\/blocking) ~\newline
 if zero\+: robot starts moving backward (non-\/blocking) other processing proceeds ~\newline
 if positive\+: robot moves backward for the given duration, in seconds\\
\hline
\end{DoxyParams}
moves Scribbler backward for a specified time and speed 
\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move backward linear range\+: -\/1.\+0 specifies move forward at full speed 0.\+0 specifies no forward/backward movement 1.\+0 specifies move backward at full speed \\
\hline
{\em time} & specifies the duration of the turn if negative\+: robot continues to go backward until given another motion command or disconnected (non-\/blocking) if nonnegative\+: robot moves backward for the given duration, in seconds \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_aa46e349ecd38fc90f8d7cea9bb8678d6}\label{_myro_c_8h_aa46e349ecd38fc90f8d7cea9bb8678d6}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Beep@{r\+Beep}}
\index{r\+Beep@{r\+Beep}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Beep()}{rBeep()}}
{\footnotesize\ttfamily void r\+Beep (\begin{DoxyParamCaption}\item[{double}]{duration,  }\item[{int}]{frequency }\end{DoxyParamCaption})}



Beeps with the given duration and frequency. 


\begin{DoxyParams}{Parameters}
{\em duration} & length of note in seconds \\
\hline
{\em frequency} & frequency of pitch in cycles per second (hertz) \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
0.\+0 $<$ duration $>$ 0.\+0 $<$= 3.\+0 seconds (Scribbler 2 hangs if duration $>$ 3.\+0014 seconds; although reason unknown, experimentation suggests part of Sribbler 2 firmware) 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_a37ccc278b3ecca6290debf1929d1e479}\label{_myro_c_8h_a37ccc278b3ecca6290debf1929d1e479}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Beep2@{r\+Beep2}}
\index{r\+Beep2@{r\+Beep2}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Beep2()}{rBeep2()}}
{\footnotesize\ttfamily void r\+Beep2 (\begin{DoxyParamCaption}\item[{double}]{duration,  }\item[{int}]{freq1,  }\item[{int}]{freq2 }\end{DoxyParamCaption})}



Generates two notes for the prescribed duration. 


\begin{DoxyParams}{Parameters}
{\em duration} & length of note in seconds \\
\hline
{\em freq1} & frequency of first pitch in cycles per second (hertz) \\
\hline
{\em freq2} & frequency of second pitch in cycles per second (hertz) \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
0.\+0 $<$ duration $<$= 3.\+0 seconds (Scribbler 2 hangs if duration $>$ 3.\+0014 seconds; although reason unknown, experimentation suggests part of Sribbler 2 firmware) 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_a43e7883a15adb7080aa331b0fb0a5965}\label{_myro_c_8h_a43e7883a15adb7080aa331b0fb0a5965}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Connect@{r\+Connect}}
\index{r\+Connect@{r\+Connect}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Connect()}{rConnect()}}
{\footnotesize\ttfamily R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE r\+Connect (\begin{DoxyParamCaption}\item[{const char $\ast$}]{address }\end{DoxyParamCaption})}



connects program to Scribbler 


\begin{DoxyParams}{Parameters}
{\em address} & string, giving name of workstation port or a Scribbler Bluetooth designation\\
\hline
\end{DoxyParams}
several string formats are possible ~\newline
 Linux and Mac\+: ~\newline
 a communications port, such as \char`\"{}/dev/rfcomm0\char`\"{} ~\newline
 a Scribbler 2 fluke serial number, such as \char`\"{}245787\char`\"{} ~\newline
 a full I\+P\+RE serial number, such as \char`\"{}\+I\+P\+R\+E245787\char`\"{} ~\newline
 a Fluke 2 serial number (hexadecimal), such as \char`\"{}021\+F\char`\"{} ~\newline
 a full Fluke 2 serial number, such as \char`\"{}\+Fluke2-\/021\+F\char`\"{} ~\newline
 Linux only\+: ~\newline
 a M\+AC address, such as \char`\"{}00\+:1\+E\+:19\+:01\+:0\+E\+:13\char`\"{} ~\newline
 Mac only\+: ~\newline
 any substring of a complete device file name, ~\newline
 as long as the resulting device is unique ~\newline
 some possibilities include ~\newline
 a complete device file name, such as ~\newline

\begin{DoxyItemize}
\item \char`\"{}/dev/tty.\+I\+P\+R\+E6-\/365877-\/\+Dev\+B\char`\"{} ~\newline

\item \char`\"{}/dev/tty.\+Fluke2-\/0958-\/\+Fluke2\char`\"{} ~\newline
 a fluke or fluke2 serial number ~\newline
 full path of symbolic link to a device filename string or substring in /dev
\end{DoxyItemize}

uniqueness is ensured by requiring 4 hex digits ~\newline
 or 6 decimal digits

\begin{DoxyReturn}{Returns}
if a connection is made the socket number/id of communications port is returned otherwise, the program exits, as robot processing cannot continue 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
on Linux and Mac computers, sockets are ints, so r\+Connect returns an int on Windows computers, sockets have type S\+O\+C\+K\+ET, so r\+Connect returns a S\+O\+C\+K\+ET together, these are defined as a R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE
\end{DoxyNote}
\begin{DoxyPostcond}{Postcondition}
subsequent communications will take place through this robot address, unless changed by r\+Set\+Connection
\end{DoxyPostcond}
connects program to Scribbler 
\begin{DoxyParams}{Parameters}
{\em address} & string, giving name of workstation port or a Scribbler Bluetooth designation\\
\hline
\end{DoxyParams}
several string formats are possible a communications port, such as \char`\"{}/dev/rfcomm0\char`\"{} a M\+AC address, such as \char`\"{}00\+:1\+E\+:19\+:01\+:0\+E\+:13\char`\"{} a Scribbler 2 fluke serial number, such as \char`\"{}245787\char`\"{} a full I\+P\+RE serial number, such as \char`\"{}\+I\+P\+R\+E245787\char`\"{} a Fluke 2 serial number (hexadecimal), such as \char`\"{}021\+F\char`\"{} a full Fluke 2 serial number, such as \char`\"{}\+Fluke2-\/021\+F\char`\"{}

\begin{DoxyReturn}{Returns}
if a connection is made the socket number of communications port is returned otherwise, the program exits, as robot processing cannot continue
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
subsequent communications will take place through this socket, unless changed by r\+Set\+Connection
\end{DoxyPostcond}

\begin{DoxyParams}{Parameters}
{\em address} & string, giving name of workstation port or a Scribbler Bluetooth designation\\
\hline
\end{DoxyParams}
several string formats are possible a complete device file name, such as
\begin{DoxyItemize}
\item \char`\"{}/dev/rfcomm0\char`\"{}
\item \char`\"{}/dev/tty.\+I\+P\+R\+E6-\/365877-\/\+Dev\+B\char`\"{}
\item \char`\"{}/dev/tty.\+Fluke2-\/0958-\/\+Fluke2\char`\"{} any substring of a complete device file name, as long as the resulting device is unique some possibilities include
\item a Scribbler 2 fluke serial number, such as \char`\"{}245787\char`\"{}
\item a full I\+P\+RE serial number, such as \char`\"{}\+I\+P\+R\+E6-\/245787\char`\"{}
\item a Fluke 2 serial number (hexadecimal), such as \char`\"{}021\+F\char`\"{}
\item a full Fluke 2 serial number, such as \char`\"{}\+Fluke2-\/021\+F\char`\"{} uniqueness is ensured by requiring 4 hex digits or 6 decimal digits the full path of a symbolic link to a device file name string or substring in /dev
\end{DoxyItemize}

Note\+: Connections via a M\+AC address, such as \char`\"{}00\+:1\+E\+:19\+:01\+:0\+E\+:13\char`\"{}, is N\+OT available, for MyroC on Mac OS X, since A\+F\+\_\+\+B\+L\+U\+E\+T\+O\+O\+TH socket types are not defined in /usr/include/sys/socket.h Type man socket for additional information

\begin{DoxyReturn}{Returns}
if a connection is made the socket number of communications port is returned otherwise, the program exits, as robot processing cannot continue
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
subsequent communications will take place through this socket, unless changed by r\+Set\+Connection 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a169e562028db3fcbbe8ab6a35476bbb8}\label{_myro_c_8h_a169e562028db3fcbbe8ab6a35476bbb8}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Disconnect@{r\+Disconnect}}
\index{r\+Disconnect@{r\+Disconnect}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Disconnect()}{rDisconnect()}}
{\footnotesize\ttfamily void r\+Disconnect (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



stop Scribbler motion and close Bluetooth 

\begin{DoxyPostcond}{Postcondition}
motion for the current robot is stopped, blocking until any non-\/blocking motion time has expired ~\newline
 i.\+e., if a motion timer is set, ~\newline
 this procedure blocks ~\newline
 when the timer completes, ~\newline
 then the motion stops ~\newline
 else, procedure stops motion immediately ~\newline
 Bluetooth for the current robot is closed

motion for the current robot is stopped, blocking until any non-\/blocking motion time has expired ~\newline
 i.\+e., if a motion timer is set, ~\newline
 this procedure blocks, then stops motion~\newline
 else, procedure stops motion immediately ~\newline
 Bluetooth for the current robot is closed 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a7e5e4188b912328a1c357b534431c2ff}\label{_myro_c_8h_a7e5e4188b912328a1c357b534431c2ff}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Display\+Image\+Processing\+Errors@{r\+Display\+Image\+Processing\+Errors}}
\index{r\+Display\+Image\+Processing\+Errors@{r\+Display\+Image\+Processing\+Errors}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Display\+Image\+Processing\+Errors()}{rDisplayImageProcessingErrors()}}
{\footnotesize\ttfamily void r\+Display\+Image\+Processing\+Errors (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Turn on and off the printing of error messasge for image processing. 

\begin{DoxyNote}{Note}
Some operating systems (e.\+g., Mac OX S High Sierra) display an error message whenevern a new process for image display starts 
\end{DoxyNote}
\begin{DoxyPostcond}{Postcondition}
This function toggles this printing on and off Initially, printing is off
\end{DoxyPostcond}
\begin{DoxyNote}{Note}
Some operating systems (e.\+g., Mac OX S High Sierra) display an error message whenevern a new process for image display starts 
\end{DoxyNote}
\begin{DoxyPostcond}{Postcondition}
This function toggles this printing on and off Initially, printing is off
\end{DoxyPostcond}
\begin{DoxyNote}{Note}
Some operating systems (e.\+g., Mac OX S High Sierra) display an error message whenevern a new process for image display starts 

Windows 10 does not generate these error messages, so this function has no useful purpose for Windows systems 
\end{DoxyNote}
\begin{DoxyPostcond}{Postcondition}
This function turns this printing on Initially, printing is off 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a9744b74cb416f7820f319e3bd349b07d}\label{_myro_c_8h_a9744b74cb416f7820f319e3bd349b07d}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Display\+Picture@{r\+Display\+Picture}}
\index{r\+Display\+Picture@{r\+Display\+Picture}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Display\+Picture()}{rDisplayPicture()}}
{\footnotesize\ttfamily void r\+Display\+Picture (\begin{DoxyParamCaption}\item[{\hyperlink{struct_picture}{Picture} $\ast$}]{pic,  }\item[{double}]{duration,  }\item[{const char $\ast$}]{window\+Title }\end{DoxyParamCaption})}



Display a picture in a new window. 


\begin{DoxyParams}{Parameters}
{\em pic} & pointer to an R\+GB picture struct from Scribbler 2 camera \\
\hline
{\em duration} & if duration $>$ 0, operation is blocking ~\newline
 if duration $<$= 0, operation is non-\/blocking ~\newline
 for duration != 0, picture displayed for abs(duration) ~\newline
 seconds or until picture closed manually or until the program terminates ~\newline
 if duration == 0, picture displayed until closed manually \\
\hline
{\em window\+Title} & The title of the window that appears. white spaces will be replaced with underscores. \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
window\+Title is less than 100 characters. 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
image is displayed for the duration specified, ~\newline
 E\+X\+C\+E\+PT all display windows are closed when the main program terminates. 
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
If images are displayed with a non-\/blocking option, and if the user wants images to appear for a full duration, use r\+Wait\+Timed\+Image\+Display or r\+Finish\+Processing to block processing until all image timers are finished. Otherwise, program termination may close windows prematurely.
\end{DoxyWarning}
Display a picture.


\begin{DoxyParams}{Parameters}
{\em pic} & pointer to an R\+GB picture struct from Scribbler 2 camera \\
\hline
{\em duration} & if duration $>$ 0, operation is blocking ~\newline
 if duration $<$= 0, operation is non-\/blocking ~\newline
 for duration != 0, picture displayed for abs(duration) ~\newline
 seconds or until picture closed manually or until the program terminates ~\newline
 if duration == 0, picture displayed until closed manually \\
\hline
{\em window\+Title} & The title of the window that appears. white spaces will be replaced with underscores. \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
window\+Title is less than 100 characters. 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
image is displayed for the duration specified, ~\newline
 E\+X\+C\+E\+PT all display windows are closed when the main program terminates. 
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
If images are displayed with a non-\/blocking option, and if the user wants images to appear for a full duration, use r\+Wait\+Timed\+Image\+Display or r\+Finish\+Processing to block processing until all image timers are finished. Otherwise, program termination may close windows prematurely. 
\end{DoxyWarning}
\mbox{\Hypertarget{_myro_c_8h_af55f107794f40ee2f77dd6817ad1453f}\label{_myro_c_8h_af55f107794f40ee2f77dd6817ad1453f}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Fast\+Forward@{r\+Fast\+Forward}}
\index{r\+Fast\+Forward@{r\+Fast\+Forward}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Fast\+Forward()}{rFastForward()}}
{\footnotesize\ttfamily void r\+Fast\+Forward (\begin{DoxyParamCaption}\item[{double}]{time }\end{DoxyParamCaption})}



moves Scribbler forward at the largest possible speed for a specified time 


\begin{DoxyParams}{Parameters}
{\em time} & specifies the duration of the turn ~\newline
 if negative\+: the robot starts forward (non-\/blocking) other processing proceeds, and the robot continues forward until given another motion command or disconnected (non-\/blocking) ~\newline
 if zero\+: robot starts moving forward (non-\/blocking); other processing proceeds ~\newline
 if positive\+: robot moves forward for the given duration, in seconds \\
\hline
\end{DoxyParams}
\begin{DoxyWarning}{Warning}
may take longer than usual to execute
\end{DoxyWarning}
moves Scribbler forward at the largest possible speed for a specified time 
\begin{DoxyParams}{Parameters}
{\em time} & specifies the duration of movement if negative\+: robot continues to move forward until given another motion command or disconnected (non-\/blocking) if nonnegative\+: robot moves forward for the given duration, in seconds \\
\hline
\end{DoxyParams}
\begin{DoxyWarning}{Warning}
may take longer than usual to execute 
\end{DoxyWarning}
\mbox{\Hypertarget{_myro_c_8h_a129a75b1d9629beca5da09688f239c0f}\label{_myro_c_8h_a129a75b1d9629beca5da09688f239c0f}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Finish\+Processing@{r\+Finish\+Processing}}
\index{r\+Finish\+Processing@{r\+Finish\+Processing}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Finish\+Processing()}{rFinishProcessing()}}
{\footnotesize\ttfamily void r\+Finish\+Processing (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



all timed motions/image displays completed, all robots stopped, and all robot Bluetooth connections closed 

same result as r\+Disconnect for all robots plus r\+Comlete\+Image\+Display

\begin{DoxyPostcond}{Postcondition}
blocks until all timed robot motions are complete, and all timed image displays no longer visible ~\newline
 upon completion, all timed images are invisible, all robot motion is halted, and all robot Bluetooth connections closed
\end{DoxyPostcond}
produces same result as calling r\+Disconnect for all robots and also calling r\+Comlete\+Image\+Display

\begin{DoxyPostcond}{Postcondition}
procedure blocks until all timed robot motions are complete, and all timed image displays are no longer visible upon completion, all timed image displays are closed, all robot motion is halted, and all robot Bluetooth connections closed 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_aaf2b57e29c053c7e3901ec5ee3cb047d}\label{_myro_c_8h_aaf2b57e29c053c7e3901ec5ee3cb047d}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Forward@{r\+Forward}}
\index{r\+Forward@{r\+Forward}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Forward()}{rForward()}}
{\footnotesize\ttfamily void r\+Forward (\begin{DoxyParamCaption}\item[{double}]{speed,  }\item[{double}]{time }\end{DoxyParamCaption})}



moves Scribbler forward for a specified time and speed 


\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move forward ~\newline
 linear range\+: -\/1.\+0 specifies move backward at full speed ~\newline
 0.\+0 specifies no forward/backward movement ~\newline
 1.\+0 specifies move forward at full speed \\
\hline
{\em time} & specifies the duration of the turn ~\newline
 if negative\+: the robot starts forward (non-\/blocking) other processing proceeds, and the robot continues forward until given another motion command or disconnected (non-\/blocking) ~\newline
 if zero\+: robot starts moving forward (non-\/blocking); other processing proceeds ~\newline
 if positive\+: robot moves forward for the given duration, in seconds\\
\hline
\end{DoxyParams}
moves Scribbler forward for a specified time and speed 
\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move forward linear range\+: -\/1.\+0 specifies move backward at full speed 0.\+0 specifies no forward/backward movement 1.\+0 specifies move forward at full speed \\
\hline
{\em time} & specifies the duration of movement if negative\+: robot continues to move forward until given another motion command or disconnected (non-\/blocking) if nonnegative\+: robot moves forward for the given duration, in seconds \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_a80896cdb3ff63acd1fa0a5ce97ba7c9d}\label{_myro_c_8h_a80896cdb3ff63acd1fa0a5ce97ba7c9d}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Battery@{r\+Get\+Battery}}
\index{r\+Get\+Battery@{r\+Get\+Battery}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Battery()}{rGetBattery()}}
{\footnotesize\ttfamily double r\+Get\+Battery (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Get the current voltage from the Scribbler batteries; Maximum charge from 6 batteries could be up to 6 volts; Manufacturer suggests batteries should be changed below 4.\+1 volts. 

\begin{DoxyReturn}{Returns}
percentage of battery voltage
\end{DoxyReturn}
Get the current voltage from the Scribbler batteries; Maximum charge from 6 batteries could be up to 6 volts; Manufacturer suggests batteries should be changed below 4.\+1 volts.

\begin{DoxyReturn}{Returns}
percentage of battery voltage 
\end{DoxyReturn}
\mbox{\Hypertarget{_myro_c_8h_a98820d670fcacb6780e68a58a4bc0a8a}\label{_myro_c_8h_a98820d670fcacb6780e68a58a4bc0a8a}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Bright\+All@{r\+Get\+Bright\+All}}
\index{r\+Get\+Bright\+All@{r\+Get\+Bright\+All}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Bright\+All()}{rGetBrightAll()}}
{\footnotesize\ttfamily void r\+Get\+Bright\+All (\begin{DoxyParamCaption}\item[{int}]{bright\+Sensors\mbox{[}3\mbox{]},  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Read the Fluke\textquotesingle{}s virtual light sensors. Since readings of each brightness sensor can vary substantially (successive readings may differ by 5000-\/10000), each sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em bright\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for bright\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
bright\+Sensors\mbox{[}0\mbox{]} gives average value for left sensor ~\newline
 bright\+Sensors\mbox{[}1\mbox{]} gives average value for middle sensor ~\newline
 bright\+Sensors\mbox{[}2\mbox{]} gives average value for right sensor ~\newline
 Brightness values near 0 represent bright light ~\newline
 Brightness values may extend to about 65535 for a dark region.
\end{DoxyPostcond}
Read the Fluke\textquotesingle{}s virtual light sensors. Since readings of each brightness sensor can vary substantially (successive readings may differ by 5000-\/10000), each sensor can be queried sample\+Size times and an average obtained.


\begin{DoxyParams}{Parameters}
{\em bright\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for bright\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
bright\+Sensors\mbox{[}0\mbox{]} gives average value for left sensor bright\+Sensors\mbox{[}1\mbox{]} gives average value for middle sensor bright\+Sensors\mbox{[}2\mbox{]} gives average value for right sensor Brightness values near 0 represent bright light Brightness values may extend to about 65535 for a very dark region. 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a6c898c1c12957822fbd0e2b68f573c4d}\label{_myro_c_8h_a6c898c1c12957822fbd0e2b68f573c4d}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Bright\+Txt@{r\+Get\+Bright\+Txt}}
\index{r\+Get\+Bright\+Txt@{r\+Get\+Bright\+Txt}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Bright\+Txt()}{rGetBrightTxt()}}
{\footnotesize\ttfamily int r\+Get\+Bright\+Txt (\begin{DoxyParamCaption}\item[{char $\ast$}]{sensor\+Name,  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Reads one of the Fluke\textquotesingle{}s virtual light sensors. Each sensor reports a total intensity in the left, middle, or right of the Fluke\textquotesingle{}s camera Since values of each obstacle sensor can vary substantially (successive readings may differ by 5000-\/10000), the sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the bright sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{}, \char`\"{}center\char`\"{}, \char`\"{}middle\char`\"{}, or \char`\"{}right\char`\"{} (not case sensitive) ~\newline
 designations \char`\"{}center\char`\"{} and \char`\"{}middle\char`\"{} are alternatives for the same bright sensor 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
reading from the specified bright sensor, averaged over sample\+Size number of data samples ~\newline
 Brightness values near 0 represent bright light ~\newline
 Brightness values may extend to about 65535 for a very dark region.
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the bright sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{}, \char`\"{}center\char`\"{}, \char`\"{}middle\char`\"{}, or \char`\"{}right\char`\"{} (not case sensitive) designations \char`\"{}center\char`\"{} and \char`\"{}middle\char`\"{} are alternatives for the same bright sensor 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
reading from the specified bright sensor, averaged over sample\+Size number of data samples Brightness values near 0 represent bright light Brightness values may extend to about 65535 for a very dark region. 
\end{DoxyReturn}
\mbox{\Hypertarget{_myro_c_8h_a07e585491ba7af9e13779f9e3db6fd31}\label{_myro_c_8h_a07e585491ba7af9e13779f9e3db6fd31}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Forwardness@{r\+Get\+Forwardness}}
\index{r\+Get\+Forwardness@{r\+Get\+Forwardness}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Forwardness()}{rGetForwardness()}}
{\footnotesize\ttfamily char$\ast$ r\+Get\+Forwardness (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the forwardness of the Scribbler. 

\begin{DoxyReturn}{Returns}
either \char`\"{}fluke-\/forward\char`\"{} or \char`\"{}scribbler-\/forward\char`\"{}
\end{DoxyReturn}
Gets the forwardness of the Scribbler \begin{DoxyReturn}{Returns}
either \char`\"{}fluke-\/forward\char`\"{} or \char`\"{}scribbler-\/forward\char`\"{} 
\end{DoxyReturn}
\mbox{\Hypertarget{_myro_c_8h_a1e10a9735a4b8dc8c79100905c30ecab}\label{_myro_c_8h_a1e10a9735a4b8dc8c79100905c30ecab}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Info@{r\+Get\+Info}}
\index{r\+Get\+Info@{r\+Get\+Info}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Info()}{rGetInfo()}}
{\footnotesize\ttfamily void r\+Get\+Info (\begin{DoxyParamCaption}\item[{char $\ast$}]{info\+Buffer }\end{DoxyParamCaption})}



returns information about the robot\textquotesingle{}s dongle, firmware, and communication mode as a 60 character array in info\+Buffer. 


\begin{DoxyParams}{Parameters}
{\em info\+Buffer} & a pre-\/defined, 60-\/character array \\
\hline
\end{DoxyParams}
\begin{DoxyPostcond}{Postcondition}
info\+Buffer contains relevant robot information
\end{DoxyPostcond}
returns information about the robot\textquotesingle{}s dongle, firmware, and communication mode as a 60 character array in info\+Buffer. 
\begin{DoxyParams}{Parameters}
{\em info\+Buffer} & a pre-\/defined, 60-\/character array \\
\hline
\end{DoxyParams}
\begin{DoxyPostcond}{Postcondition}
info\+Buffer contains relevant robot information 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_ab4bf6868424a63a95a85decea8a93fc2}\label{_myro_c_8h_ab4bf6868424a63a95a85decea8a93fc2}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+I\+R\+All@{r\+Get\+I\+R\+All}}
\index{r\+Get\+I\+R\+All@{r\+Get\+I\+R\+All}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+I\+R\+All()}{rGetIRAll()}}
{\footnotesize\ttfamily void r\+Get\+I\+R\+All (\begin{DoxyParamCaption}\item[{int}]{ir\+Sensors\mbox{[}2\mbox{]},  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Get an array of true/false values regarding the presence of obstacle based on the average values of each of the three IR sensors. Since readings of each light sensor can vary substantially, each sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em ir\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for ir\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
ir\+Sensors\mbox{[}0\mbox{]} checks obstacle for left sensor ~\newline
 ir\+Sensors\mbox{[}1\mbox{]} checks obstacle for right sensor 

for each ir\+Sensors array value ~\newline
 return 0 indicates no obstacle detected ~\newline
 return 1 indicates obstacle detected
\end{DoxyPostcond}
Get an array of true/false values regarding the presence of obstacle based on the average values of each of the three IR sensors. Since readings of each light sensor can vary substantially, each sensor can be queried sample\+Size times and an average obtained.


\begin{DoxyParams}{Parameters}
{\em ir\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for ir\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
ir\+Sensors\mbox{[}0\mbox{]} checks obstacle for left sensor ir\+Sensors\mbox{[}1\mbox{]} checks obstacle for right sensor 

for each ir\+Sensors array value return 0 indicates no obstacle detected return 1 indicates obstacle detected 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_afdf7579ce632c07de1d90f27d67abff7}\label{_myro_c_8h_afdf7579ce632c07de1d90f27d67abff7}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+I\+R\+Txt@{r\+Get\+I\+R\+Txt}}
\index{r\+Get\+I\+R\+Txt@{r\+Get\+I\+R\+Txt}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+I\+R\+Txt()}{rGetIRTxt()}}
{\footnotesize\ttfamily int r\+Get\+I\+R\+Txt (\begin{DoxyParamCaption}\item[{const char $\ast$}]{sensor\+Name,  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Use specified IR sensor to determine if obstacle is present. Since values of each light sensor can vary substantially, the sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the light sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{} or \char`\"{}right\char`\"{} (not case sensitive) 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
true/false (0/1) determination of obstacle, based on IR sensor\+Name sensor, averaged over sample\+Size number of data samples 
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
return 0 indicates no obstacle detected ~\newline
 return 1 indicates obstacle detected
\end{DoxyPostcond}

\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the light sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{} or \char`\"{}right\char`\"{} (not case sensitive) 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
true/false (0/1) determination of obstacle, based on IR sensor\+Name sensor, averaged over sample\+Size number of data samples 
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
return 0 indicates no obstacle detected return 1 indicates obstacle detected 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a9006ba8c581c7543d7d460d76c06d077}\label{_myro_c_8h_a9006ba8c581c7543d7d460d76c06d077}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Lights\+All@{r\+Get\+Lights\+All}}
\index{r\+Get\+Lights\+All@{r\+Get\+Lights\+All}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Lights\+All()}{rGetLightsAll()}}
{\footnotesize\ttfamily void r\+Get\+Lights\+All (\begin{DoxyParamCaption}\item[{int}]{light\+Sensors\mbox{[}3\mbox{]},  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Get the average values of each of the three light sensors in an array. Values of each light sensor can somewhat (typically under 5\%-\/10\%). To even out variability, the sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em light\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for light\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
light\+Sensors\mbox{[}0\mbox{]} gives average value for left sensor ~\newline
 light\+Sensors\mbox{[}1\mbox{]} gives average value for middle sensor ~\newline
 light\+Sensors\mbox{[}2\mbox{]} gives average value for right sensor ~\newline
 Intensity values near 0 represent bright light ~\newline
 Intensities may extend to about 65000 for a dark region.
\end{DoxyPostcond}

\begin{DoxyParams}{Parameters}
{\em light\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for light\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
light\+Sensors\mbox{[}0\mbox{]} gives average value for left sensor light\+Sensors\mbox{[}1\mbox{]} gives average value for middle sensor light\+Sensors\mbox{[}2\mbox{]} gives average value for right sensor Intensity values near 0 represent bright light Intensities may extend to about 65000 for a very dark region. 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_aaba34be55fd5db7d8c1ed08ea7caa6c2}\label{_myro_c_8h_aaba34be55fd5db7d8c1ed08ea7caa6c2}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Light\+Txt@{r\+Get\+Light\+Txt}}
\index{r\+Get\+Light\+Txt@{r\+Get\+Light\+Txt}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Light\+Txt()}{rGetLightTxt()}}
{\footnotesize\ttfamily int r\+Get\+Light\+Txt (\begin{DoxyParamCaption}\item[{const char $\ast$}]{sensor\+Name,  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Get the average values of a specified light sensor. Values of each light sensor can somewhat (typically under 5\%-\/10\%). To even out variability, the sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the light sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{}, \char`\"{}center\char`\"{}, \char`\"{}middle\char`\"{}, or \char`\"{}right\char`\"{} (not case sensitive) ~\newline
 designations \char`\"{}center\char`\"{} and \char`\"{}middle\char`\"{} are alternatives for the same light sensor 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
reading from the specified light sensor, averaged over sample\+Size number of data samples ~\newline
 if sensor\+Name invalid, returns -\/1.\+0
\end{DoxyReturn}
Get the average values of a specified light sensor. Values of each light sensor can somewhat (typically under 5\%-\/10\%). To even out variability, the sensor can be queried sample\+Size times and an average obtained.


\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the light sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{}, \char`\"{}center\char`\"{}, \char`\"{}middle\char`\"{}, or \char`\"{}right\char`\"{} (not case sensitive) designations \char`\"{}center\char`\"{} and \char`\"{}middle\char`\"{} are alternatives for the same light sensor 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
reading from the specified light sensor, averaged over sample\+Size number of data samples if sensor\+Name invalid, returns -\/1.\+0 
\end{DoxyReturn}
\mbox{\Hypertarget{_myro_c_8h_a7fc13d53088ba239a95c99b46b9607e8}\label{_myro_c_8h_a7fc13d53088ba239a95c99b46b9607e8}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Line@{r\+Get\+Line}}
\index{r\+Get\+Line@{r\+Get\+Line}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Line()}{rGetLine()}}
{\footnotesize\ttfamily void r\+Get\+Line (\begin{DoxyParamCaption}\item[{int}]{line\+Sensors\mbox{[}2\mbox{]},  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Use Scribbler 2 line sensors of Scribbler to check for a black line on a white surface under the robot. Since values of each light sensor can vary substantially, the sensor can be queried sample\+Size times and an average obtained. 

\begin{DoxyWarning}{Warning}
results of these sensors may be flakey! 
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em line\+Sensors} & array to store line values detected \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for line\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
line\+Sensors\mbox{[}0\mbox{]} checks left sensor for line ~\newline
 line\+Sensors\mbox{[}1\mbox{]} checks right sensor for line 

for each ir\+Sensors array value ~\newline
 return 0 indicates line is identified ~\newline
 return 1 indicates line is not identified
\end{DoxyPostcond}
Use Scribbler 2 line sensors of Scribbler to check for a black line on a white surface under the robot. Since values of each light sensor can vary substantially, the sensor can be queried sample\+Size times and an average obtained.

\begin{DoxyWarning}{Warning}
results of these sensors may be flakey! 
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em line\+Sensors} & array to store line values detected \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for line\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
line\+Sensors\mbox{[}0\mbox{]} checks left sensor for line line\+Sensors\mbox{[}1\mbox{]} checks right sensor for line (left/right based on Scribbler-\/forward orientation) 

for each line sensors array value return 0 indicates line is identified (light color under Scribbler) return 1 indicates line is not identified (dark color) 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_ab3e6bd45aea018d47bf98348c1315483}\label{_myro_c_8h_ab3e6bd45aea018d47bf98348c1315483}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Name@{r\+Get\+Name}}
\index{r\+Get\+Name@{r\+Get\+Name}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Name()}{rGetName()}}
{\footnotesize\ttfamily char$\ast$ r\+Get\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Get the name of the robot. 

\begin{DoxyReturn}{Returns}
information about the name of the robot 
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
the returned name is a newly-\/allocated 17-\/byte string 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a3a47f1f85c9fa6d68b5ebd8c0ad2e484}\label{_myro_c_8h_a3a47f1f85c9fa6d68b5ebd8c0ad2e484}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Obstacle\+All@{r\+Get\+Obstacle\+All}}
\index{r\+Get\+Obstacle\+All@{r\+Get\+Obstacle\+All}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Obstacle\+All()}{rGetObstacleAll()}}
{\footnotesize\ttfamily void r\+Get\+Obstacle\+All (\begin{DoxyParamCaption}\item[{int}]{obst\+Sensors\mbox{[}3\mbox{]},  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Get the average values of the three obstacle sensors in an array. Since readings of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), each sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em obst\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for obst\+Sensors array; sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
obst\+Sensors\mbox{[}0\mbox{]} gives average value for left sensor ~\newline
 obst\+Sensors\mbox{[}1\mbox{]} gives average value for middle sensor ~\newline
 obst\+Sensors\mbox{[}2\mbox{]} gives average value for right sensor ~\newline
 Returned values are between 0 and 6400 ~\newline
 Obstacle values near 0 represent no obstacle seen ~\newline
 Obstacle values may approach 6400 as obstacle gets close. 
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
As battery degrades, sensor readings degrade, yielding systematically lower numbers.
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em obst\+Sensors} & array to store intensity values \\
\hline
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for obst\+Sensors array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
obst\+Sensors\mbox{[}0\mbox{]} gives average value for left sensor obst\+Sensors\mbox{[}1\mbox{]} gives average value for middle sensor obst\+Sensors\mbox{[}2\mbox{]} gives average value for right sensor Returned values are between 0 and 6400 Obstacle values near 0 represent no obstacle seen Obstacle values may approach 6400 as obstacle gets close. 
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
As battery degrades, sensor readings degrade, yielding systematically lower numbers. 
\end{DoxyWarning}
\mbox{\Hypertarget{_myro_c_8h_a5853bf9f106b47ed0e767adf8fab0d0b}\label{_myro_c_8h_a5853bf9f106b47ed0e767adf8fab0d0b}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Obstacle\+Txt@{r\+Get\+Obstacle\+Txt}}
\index{r\+Get\+Obstacle\+Txt@{r\+Get\+Obstacle\+Txt}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Obstacle\+Txt()}{rGetObstacleTxt()}}
{\footnotesize\ttfamily int r\+Get\+Obstacle\+Txt (\begin{DoxyParamCaption}\item[{const char $\ast$}]{sensor\+Name,  }\item[{int}]{sample\+Size }\end{DoxyParamCaption})}



Get the average values of a specified obstacle (IR) sensor. Since values of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), the sensor can be queried sample\+Size times and an average obtained. 


\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the obstacle sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{}, \char`\"{}center\char`\"{}, \char`\"{}middle\char`\"{}, or \char`\"{}right\char`\"{} (not case sensitive) ~\newline
 designations \char`\"{}center\char`\"{} and \char`\"{}middle\char`\"{} are alternatives for the same light sensor 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for vals array; sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
reading from the specified obstacle sensor, averaged over sample\+Size number of data samples ~\newline
 Returned values are between 0 and 6400 ~\newline
 Obstacle values near 0 represent no obstacle seen ~\newline
 Obstacle values may approach 6400 as obstacle gets close. 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
As battery degrades, sensor values degrade, yielding systematically lower numbers.
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em sensor\+Name} & name of the obstacle sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sensor\+Name is \char`\"{}left\char`\"{}, \char`\"{}center\char`\"{}, \char`\"{}middle\char`\"{}, or \char`\"{}right\char`\"{} (not case sensitive) designations \char`\"{}center\char`\"{} and \char`\"{}middle\char`\"{} are alternatives for the same light sensor 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for the sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
space already allocated for vals array sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
reading from the specified obstacle sensor, averaged over sample\+Size number of data samples Returned values are between 0 and 6400 Obstacle values near 0 represent no obstacle seen Obstacle values may approach 6400 as obstacle gets close. 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
As battery degrades, sensor values degrade, yielding systematically lower numbers. 
\end{DoxyWarning}
\mbox{\Hypertarget{_myro_c_8h_a9296f6acbac4ef59cfc6cb0dc535c60f}\label{_myro_c_8h_a9296f6acbac4ef59cfc6cb0dc535c60f}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Get\+Stall@{r\+Get\+Stall}}
\index{r\+Get\+Stall@{r\+Get\+Stall}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Get\+Stall()}{rGetStall()}}
{\footnotesize\ttfamily int r\+Get\+Stall (\begin{DoxyParamCaption}\item[{int}]{sample\+Size }\end{DoxyParamCaption})}

Determine if robot has stalled

MyroC Reference Manual (\href{http://wiki.roboteducation.org/Myro_Reference_Manual}{\tt http\+://wiki.\+roboteducation.\+org/\+Myro\+\_\+\+Reference\+\_\+\+Manual}) states "Every time you issue a move command, the stall sensor resets, and it needs to wait a short time to see whether the motors are stalled. This means that the sensor won\textquotesingle{}t give accurate results if you test it too soon after the robot starts to move."

In practice, it may take 0.\+5-\/1.\+0 seconds for r\+Get\+Stall to sense the robot is stalled


\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
whether or not robot current has stalled 
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
Returns 1 if the robot has stalled ~\newline
 Returns 0 otherwise.
\end{DoxyPostcond}
Determine if robot has stalled

MyroC Reference Manual (\href{http://wiki.roboteducation.org/Myro_Reference_Manual}{\tt http\+://wiki.\+roboteducation.\+org/\+Myro\+\_\+\+Reference\+\_\+\+Manual}) states Every time you issue a move command, the stall sensor resets, and it needs to wait a short time to see whether the motors are stalled. This means that the sensor won\textquotesingle{}t give accurate results if you test it too soon after the robot starts to move.

In practice, it may take 0.\+5-\/1.\+0 seconds for r\+Get\+Stall to sense the robot is stalled


\begin{DoxyParams}{Parameters}
{\em sample\+Size} & how many readings are taken for each sensor \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
sample\+Size $>$ 0 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
whether or not robot current has stalled 
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
Returns 1 if the robot has stalled Returns 0 otherwise. 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_ae0c1a7d7ba14f6efb8df0db1f4bc08b9}\label{_myro_c_8h_ae0c1a7d7ba14f6efb8df0db1f4bc08b9}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Hard\+Stop@{r\+Hard\+Stop}}
\index{r\+Hard\+Stop@{r\+Hard\+Stop}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Hard\+Stop()}{rHardStop()}}
{\footnotesize\ttfamily void r\+Hard\+Stop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



cuts power to the motor of the robot 

cuts power to the motor of the robot \mbox{\Hypertarget{_myro_c_8h_a22bed206f3ae7563a116be255e91906e}\label{_myro_c_8h_a22bed206f3ae7563a116be255e91906e}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Load\+Picture@{r\+Load\+Picture}}
\index{r\+Load\+Picture@{r\+Load\+Picture}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Load\+Picture()}{rLoadPicture()}}
{\footnotesize\ttfamily \hyperlink{struct_picture}{Picture} r\+Load\+Picture (\begin{DoxyParamCaption}\item[{char $\ast$}]{filename }\end{DoxyParamCaption})}



Load a picture from a .jpeg file. 


\begin{DoxyParams}{Parameters}
{\em filename} & the name of the file \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
file must exist 

file extension must be .jpeg or .jpg 

file must be no larger than 266 by 427 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
\hyperlink{struct_picture}{Picture}
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em filename} & the name of the file \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
file must exist 

file extension must be .jpeg or .jpg 

file must be no larger than 266 by 427 
\end{DoxyPrecond}
\begin{DoxyReturn}{Returns}
locally-\/declared \hyperlink{struct_picture}{Picture} 
\end{DoxyReturn}
\begin{DoxyPostcond}{Postcondition}
calling program should store returned \hyperlink{struct_picture}{Picture} in a previously-\/declared struct 
\end{DoxyPostcond}
\mbox{\Hypertarget{_myro_c_8h_a6712dd6e8442e19ff28158adeaf7c0d0}\label{_myro_c_8h_a6712dd6e8442e19ff28158adeaf7c0d0}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Motors@{r\+Motors}}
\index{r\+Motors@{r\+Motors}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Motors()}{rMotors()}}
{\footnotesize\ttfamily void r\+Motors (\begin{DoxyParamCaption}\item[{double}]{left\+Speed,  }\item[{double}]{right\+Speed }\end{DoxyParamCaption})}



move robot with given speeds for the left and right motors continues until given another motion command or disconnected (non-\/blocking) 


\begin{DoxyParams}{Parameters}
{\em left\+Speed} & the rate at which the left wheel should turn ~\newline
 linear range\+: -\/1.\+0 specifies move backward at full speed ~\newline
 0.\+0 specifies no forward/backward movement ~\newline
 1.\+0 specifies move forwardward at full speed \\
\hline
{\em right\+Speed} & the rate at which the right wheel should turn ~\newline
 linear range\+: -\/1.\+0 specifies move backward at full speed ~\newline
 0.\+0 specifies no forward/backward movement ~\newline
 1.\+0 specifies move forward at full speed\\
\hline
\end{DoxyParams}
move robot with given speeds for the left and right motors continues until given another motion command or disconnected (non-\/blocking) 
\begin{DoxyParams}{Parameters}
{\em left\+Speed} & the rate at which the left wheel should turn linear range\+: -\/1.\+0 specifies move backward at full speed 0.\+0 specifies no forward/backward movement 1.\+0 specifies move forwardward at full speed \\
\hline
{\em right\+Speed} & the rate at which the right wheel should turn linear range\+: -\/1.\+0 specifies move backward at full speed 0.\+0 specifies no forward/backward movement 1.\+0 specifies move forward at full speed \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_ace59c91f90d0bd811b3df1d3ddcf14e3}\label{_myro_c_8h_ace59c91f90d0bd811b3df1d3ddcf14e3}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Save\+Picture@{r\+Save\+Picture}}
\index{r\+Save\+Picture@{r\+Save\+Picture}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Save\+Picture()}{rSavePicture()}}
{\footnotesize\ttfamily void r\+Save\+Picture (\begin{DoxyParamCaption}\item[{\hyperlink{struct_picture}{Picture} $\ast$}]{pic,  }\item[{char $\ast$}]{filename }\end{DoxyParamCaption})}



Save a \hyperlink{struct_picture}{Picture} to a .jpeg. 


\begin{DoxyParams}{Parameters}
{\em pic} & pointer to an R\+GB picture struct from Scribbler 2 camera \\
\hline
{\em filename} & the name of the file \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
filename ends with .jpeg or .jpg. 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
If the file does not exist, a new file will be created. 

If the file exists, the file will be overwritten.
\end{DoxyPostcond}
This section contains functions for taking and manipulating images All images are constrained with height $<$= 266 and width $<$= 427

images from robot cameras have varying sizes, depending on the Fluke images for the original Fluke are 192 (height) by 256 (width) low-\/resolution images for the Fluke 2 are 266 by 427 high-\/resolution images for the fluke 2 are 800 by 1280 (not supported)

Bluetooth communication constrains the time required for the Fluke to take a picture Typical times\+: original fluke\+: 2-\/ 4 seconds Fluke 2 (low res)\+: 4-\/ 6 seconds Fluke 2 (high res)\+: 25-\/30 seconds

B\+A\+S\+ED ON T\+I\+M\+I\+N\+GS A\+ND M\+E\+M\+O\+RY C\+O\+N\+S\+I\+D\+E\+R\+A\+T\+I\+O\+NS, Myro C A\+L\+L\+O\+WS O\+N\+LY L\+OW R\+E\+S\+O\+L\+U\+T\+I\+ON I\+M\+A\+G\+ES

the \hyperlink{struct_picture}{Picture} struct allows direct access to \hyperlink{struct_pixel}{Pixel} data Pictures can be saved and loaded as .jpeg files

\begin{DoxyNote}{Note}
Following standard mathematical convention for a 2D matrix, all references to a pixel are given within an array as \mbox{[}row\mbox{]}\mbox{[}col\mbox{]} 

user-\/defined images may have any size, as long as height $<$= 266 and width $<$= 427 

Following standard mathematical convention for a 2D matrix, all references to a pixel are given within an array as \mbox{[}row\mbox{]}\mbox{[}col\mbox{]}
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
The \hyperlink{struct_picture}{Picture} struct is defined to be sufficiently large to store several low-\/resolution camera images (340756 bytes each) Experimentally, an array of up to 94 (not 95) Pictures is allowed However, the display of images requires that image data be copied, so display of many images may not work If a program hangs when working with \hyperlink{struct_picture}{Picture} variables, the issue may involve lack of space on the runtime stack. To utilize a modest number of Pictures, use \char`\"{}ulimit -\/s\char`\"{} command, as needed, in a terminal window For example, ulimit -\/s 32768 Sizes above 32768 may not be allowed in Linux or Mac OS X Save a \hyperlink{struct_picture}{Picture} to a .jpeg 
\end{DoxyWarning}

\begin{DoxyParams}{Parameters}
{\em pic} & pointer to an R\+GB picture struct from Scribbler 2 camera \\
\hline
{\em filename} & the name of the file \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
filename ends with .jpeg or .jpg. 
\end{DoxyPrecond}
\begin{DoxyPostcond}{Postcondition}
If the file does not exist, a new file will be created. 

If the file exists, the file will be overwritten.
\end{DoxyPostcond}
this code is a slightly modified version of write\+\_\+\+J\+P\+E\+G\+\_\+file(char $\ast$, int) from example.\+c from the libjpeg.\+v8d library directory. \mbox{\Hypertarget{_myro_c_8h_ac7c83fef113af1c3612ce59c03417e8b}\label{_myro_c_8h_ac7c83fef113af1c3612ce59c03417e8b}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+Bluetooth\+Echo@{r\+Set\+Bluetooth\+Echo}}
\index{r\+Set\+Bluetooth\+Echo@{r\+Set\+Bluetooth\+Echo}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+Bluetooth\+Echo()}{rSetBluetoothEcho()}}
{\footnotesize\ttfamily void r\+Set\+Bluetooth\+Echo (\begin{DoxyParamCaption}\item[{char}]{on\+Off }\end{DoxyParamCaption})}



Turn on and off the printing transmission and echong of Bluetooth transmissions All robot commands involve the transmission of a command over Bluetooth Scribbler commands are always 9 bytes ~\newline
 Fluke commands have varying lengths ~\newline
The fluke echos most, but not all, of the commands ~\newline
For many commands, the fluke also echos 11 bytes of sensor data. 


\begin{DoxyParams}{Parameters}
{\em on\+Off} & char \textquotesingle{}y\textquotesingle{} enables printing of Bluetooth communications ~\newline
 char \textquotesingle{}n\textquotesingle{} disables printng ~\newline
 other character values ignored\\
\hline
\end{DoxyParams}
Turn on and off the printing transmission and echong of Bluetooth transmissions All robot commands involve the transmission of a command over Bluetooth Scribbler commands are always 9 bytes ~\newline
 Fluke commands have varying lengths ~\newline
The fluke echos most, but not all, of the commands ~\newline
For many commands, the fluke also echos 11 bytes of sensor data.


\begin{DoxyParams}{Parameters}
{\em on\+Off} & char \textquotesingle{}y\textquotesingle{} enables echoing char \textquotesingle{}n\textquotesingle{} disables echoing other character values ignored \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_a0bb37dac7cc80ce6c858f5de88efc9fe}\label{_myro_c_8h_a0bb37dac7cc80ce6c858f5de88efc9fe}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+Connection@{r\+Set\+Connection}}
\index{r\+Set\+Connection@{r\+Set\+Connection}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+Connection()}{rSetConnection()}}
{\footnotesize\ttfamily void r\+Set\+Connection (\begin{DoxyParamCaption}\item[{R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE}]{new\+\_\+socket\+\_\+num }\end{DoxyParamCaption})}



set current connection to the socket number 


\begin{DoxyParams}{Parameters}
{\em new\+\_\+socket\+\_\+num} & the number of an open socket for communication \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
new\+\_\+socket\+\_\+num has been returned by r\+Connect the designated socket has not been closed 
\end{DoxyPrecond}
\begin{DoxyNote}{Note}
a socket has type int on Linux or Mac; type S\+O\+C\+K\+ET on Windows together these are defined as R\+O\+B\+O\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+Y\+PE
\end{DoxyNote}
set current connection to the socket number 
\begin{DoxyParams}{Parameters}
{\em new\+\_\+socket\+\_\+num} & the number of an open socket for communication \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
new\+\_\+socket\+\_\+num has been returned by r\+Connect the designated socket has not been closed 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_a3753b86dcb4de002e8456501ca35edae}\label{_myro_c_8h_a3753b86dcb4de002e8456501ca35edae}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+Forwardness@{r\+Set\+Forwardness}}
\index{r\+Set\+Forwardness@{r\+Set\+Forwardness}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+Forwardness()}{rSetForwardness()}}
{\footnotesize\ttfamily void r\+Set\+Forwardness (\begin{DoxyParamCaption}\item[{char $\ast$}]{direction }\end{DoxyParamCaption})}



specifies which end of the Scribbler is considered the front 


\begin{DoxyParams}{Parameters}
{\em direction} & identifies front direction \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
direction is either \char`\"{}fluke-\/forward\char`\"{} or \char`\"{}scribbler-\/forward\char`\"{} (not case sensitive)
\end{DoxyPrecond}
specifies which end of the Scribbler is considered the front 
\begin{DoxyParams}{Parameters}
{\em direction} & identifies front direction \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
direction is either \char`\"{}fluke-\/forward\char`\"{} or \char`\"{}scribbler-\/forward\char`\"{} (not case sensitive) 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_a9e21fdea3dffc9e336739c8e7d455b59}\label{_myro_c_8h_a9e21fdea3dffc9e336739c8e7d455b59}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+Forwardness\+Txt@{r\+Set\+Forwardness\+Txt}}
\index{r\+Set\+Forwardness\+Txt@{r\+Set\+Forwardness\+Txt}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+Forwardness\+Txt()}{rSetForwardnessTxt()}}
{\footnotesize\ttfamily void r\+Set\+Forwardness\+Txt (\begin{DoxyParamCaption}\item[{char $\ast$}]{direction }\end{DoxyParamCaption})}



alternative to r\+Set\+Forwardness for compatibility with earlier MyroC 

alternative to r\+Set\+Forwardness for compatibility with earlier MyroC \mbox{\Hypertarget{_myro_c_8h_ab319898f4ab7d48f15e1215db8e5b4ba}\label{_myro_c_8h_ab319898f4ab7d48f15e1215db8e5b4ba}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+I\+R\+Power@{r\+Set\+I\+R\+Power}}
\index{r\+Set\+I\+R\+Power@{r\+Set\+I\+R\+Power}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+I\+R\+Power()}{rSetIRPower()}}
{\footnotesize\ttfamily void r\+Set\+I\+R\+Power (\begin{DoxyParamCaption}\item[{int}]{power }\end{DoxyParamCaption})}



Set the amount of power for the dongle\textquotesingle{}s IR sensors. 


\begin{DoxyParams}{Parameters}
{\em power} & the desired power level for the IR sensors \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
power is between 0 and 255 (inclusive) ~\newline
 Manufacturer notes\+: default value is 135 ~\newline
 if IR obstacle sensor is always high, try lowering IR power ~\newline
 if IR obstacle sensor is always low, try raising IR power ~\newline
 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em power} & the desired power level for the IR sensors \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
power is between 0 and 255 (inclusive) 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_a2466176fa2332b88e5013d6b3fe9ceb8}\label{_myro_c_8h_a2466176fa2332b88e5013d6b3fe9ceb8}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+L\+E\+D\+Back@{r\+Set\+L\+E\+D\+Back}}
\index{r\+Set\+L\+E\+D\+Back@{r\+Set\+L\+E\+D\+Back}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+L\+E\+D\+Back()}{rSetLEDBack()}}
{\footnotesize\ttfamily void r\+Set\+L\+E\+D\+Back (\begin{DoxyParamCaption}\item[{double}]{led }\end{DoxyParamCaption})}



Set the the intensity of the back fluke L\+ED. 


\begin{DoxyParams}{Parameters}
{\em led} & intensity of the L\+ED ~\newline
 values between 0 and 1 provide a range of brightness from off to full intensity ~\newline
 values bigger than 1 are treated as 1 (full brightness) ~\newline
 values less than 0 are treated as 0 (L\+ED off)\\
\hline
\end{DoxyParams}
Set the the intensity of the back fluke L\+ED, 
\begin{DoxyParams}{Parameters}
{\em led} & intensity of the L\+ED values between 0 and 1 provide a range of brightness from off to full intensity values bigger than 1 are treated as 1 (full brightness) values less than 0 are treated as 0 (L\+ED off). \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_a21581ded1f409300e8f63f4c41c2f2f0}\label{_myro_c_8h_a21581ded1f409300e8f63f4c41c2f2f0}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+L\+E\+D\+Front@{r\+Set\+L\+E\+D\+Front}}
\index{r\+Set\+L\+E\+D\+Front@{r\+Set\+L\+E\+D\+Front}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+L\+E\+D\+Front()}{rSetLEDFront()}}
{\footnotesize\ttfamily void r\+Set\+L\+E\+D\+Front (\begin{DoxyParamCaption}\item[{int}]{led }\end{DoxyParamCaption})}



Set the front \mbox{[}fluke\mbox{]} L\+ED on or off. 


\begin{DoxyParams}{Parameters}
{\em led} & value 1 turns on L\+ED value 0 turns off L\+ED \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
led must be 0 or 1
\end{DoxyPrecond}
Set the front \mbox{[}fluke\mbox{]} L\+ED on or off 
\begin{DoxyParams}{Parameters}
{\em led} & value 1 turns on L\+ED value 0 turns off L\+ED \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
led must be 0 or 1 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_ab6f8b6b28334162e70f7cf3a3b165e4b}\label{_myro_c_8h_ab6f8b6b28334162e70f7cf3a3b165e4b}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+Name@{r\+Set\+Name}}
\index{r\+Set\+Name@{r\+Set\+Name}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+Name()}{rSetName()}}
{\footnotesize\ttfamily void r\+Set\+Name (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Change name stored in the robot to the 16-\/byte name given. 


\begin{DoxyParams}{Parameters}
{\em name} & specifies new name of robot ~\newline
 if $<$ 16 bytes given, name is filled with null characters ~\newline
 if $>$= 16 bytes given, name is truncated to 15 bytes plus null ~\newline
 Change name stored in the robot to the 16-\/byte name given \\
\hline
{\em name} & specifies new name of robot if $<$ 16 bytes given, name is filled with null characters if $>$= 16 bytes given, name is truncated to 15 bytes plus null \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_a93bc73071c06f3d81c843124f5308368}\label{_myro_c_8h_a93bc73071c06f3d81c843124f5308368}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Set\+Volume@{r\+Set\+Volume}}
\index{r\+Set\+Volume@{r\+Set\+Volume}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Set\+Volume()}{rSetVolume()}}
{\footnotesize\ttfamily void r\+Set\+Volume (\begin{DoxyParamCaption}\item[{char}]{high\+Mute }\end{DoxyParamCaption})}



Set sound to high volume (H) or mute (M)  high\+Mute set volume of Scribbler. 

\begin{DoxyPrecond}{Precondition}
high\+Mute is \textquotesingle{}H\textquotesingle{} to set for high volume or \textquotesingle{}M\textquotesingle{} for mute
\end{DoxyPrecond}
Set sound to high volume (H) or mute (M)  high\+Mute set volume of Scribbler.

\begin{DoxyPrecond}{Precondition}
high\+Mute is \textquotesingle{}H\textquotesingle{} Oto set for high volume or \textquotesingle{}M\textquotesingle{} for mute 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_ac561c993b092a153091bb20d2e4aca45}\label{_myro_c_8h_ac561c993b092a153091bb20d2e4aca45}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Stop@{r\+Stop}}
\index{r\+Stop@{r\+Stop}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Stop()}{rStop()}}
{\footnotesize\ttfamily void r\+Stop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



directs robot to stop movement 

directs robot to stop movement \mbox{\Hypertarget{_myro_c_8h_a4e10733a73b58955046a5cf2252117a0}\label{_myro_c_8h_a4e10733a73b58955046a5cf2252117a0}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Take\+Picture@{r\+Take\+Picture}}
\index{r\+Take\+Picture@{r\+Take\+Picture}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Take\+Picture()}{rTakePicture()}}
{\footnotesize\ttfamily \hyperlink{struct_picture}{Picture} r\+Take\+Picture (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Use the camera to take a photo. 

This section contains functions for taking and manipulating images All images are constrained with height $<$= 266 and width $<$= 427

images from robot cameras have varying sizes, depending on the Fluke images for the original Fluke are 192 (height) by 256 (width) low-\/resolution images for the Fluke 2 are 266 by 427 high-\/resolution images for the fluke 2 are 800 by 1280

Bluetooth communication constrains the time required for the Fluke to take a picture Typical times\+: original fluke\+: 2-\/ 4 seconds Fluke 2 (low res)\+: 4-\/ 6 seconds Fluke 2 (high res)\+: 25-\/30 seconds

B\+A\+S\+ED ON T\+I\+M\+I\+N\+GS A\+ND M\+E\+M\+O\+RY C\+O\+N\+S\+I\+D\+E\+R\+A\+T\+I\+O\+NS, Myro C A\+L\+L\+O\+WS O\+N\+LY L\+OW R\+E\+S\+O\+L\+U\+T\+I\+ON I\+M\+A\+G\+ES

the \hyperlink{struct_picture}{Picture} struct allows direct access to \hyperlink{struct_pixel}{Pixel} data Pictures can be saved and loaded as .jpeg files

\begin{DoxyNote}{Note}
Following standard mathematical convention for a 2D matrix, all references to a pixel are given within an array as \mbox{[}row\mbox{]}\mbox{[}col\mbox{]} 

user-\/defined images may have any size, as long as height $<$= 266 and width $<$= 427 

Following standard mathematical convention for a 2D matrix, all references to a pixel are given within an array as \mbox{[}row\mbox{]}\mbox{[}col\mbox{]}
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
The \hyperlink{struct_picture}{Picture} struct is defined to be sufficiently large to store several low-\/resolution camera images (340756 bytes each) Experimentally, an array of up to 94 (not 95) Pictures is allowed However, the display of images requires that image data be copied, so display of many images may not work If a program hangs when working with \hyperlink{struct_picture}{Picture} variables, the issue may involve lack of space on the runtime stack. To utilize a modest number of Pictures, use \char`\"{}ulimit -\/s\char`\"{} command, as needed, in a terminal window For example, ulimit -\/s 32768 Sizes above 32768 may not be allowed in Linux or Mac OS X 
\end{DoxyWarning}
\begin{DoxyReturn}{Returns}
\hyperlink{struct_picture}{Picture}
\end{DoxyReturn}
This section contains functions for taking and manipulating images All images are constrained with height $<$= 266 and width $<$= 427

images from robot cameras have varying sizes, depending on the Fluke images for the original Fluke are 192 (height) by 256 (width) low-\/resolution images for the Fluke 2 are 266 by 427 high-\/resolution images for the fluke 2 are 800 by 1280

Bluetooth communication constrains the time required for the Fluke to take a picture Typical times\+: original fluke\+: 2-\/ 4 seconds Fluke 2 (low res)\+: 4-\/ 6 seconds Fluke 2 (high res)\+: 25-\/30 seconds

B\+A\+S\+ED ON T\+I\+M\+I\+N\+GS A\+ND M\+E\+M\+O\+RY C\+O\+N\+S\+I\+D\+E\+R\+A\+T\+I\+O\+NS, Myro C A\+L\+L\+O\+WS O\+N\+LY L\+OW R\+E\+S\+O\+L\+U\+T\+I\+ON I\+M\+A\+G\+ES

the \hyperlink{struct_picture}{Picture} struct allows direct access to \hyperlink{struct_pixel}{Pixel} data Pictures can be saved and loaded as .jpeg files

\begin{DoxyNote}{Note}
Following standard mathematical convention for a 2D matrix, all references to a pixel are given within an array as \mbox{[}row\mbox{]}\mbox{[}col\mbox{]} 

user-\/defined images may have any size, as long as height $<$= 266 and width $<$= 427 

Following standard mathematical convention for a 2D matrix, all references to a pixel are given within an array as \mbox{[}row\mbox{]}\mbox{[}col\mbox{]}
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
The \hyperlink{struct_picture}{Picture} struct is defined to be sufficiently large to store several low-\/resolution camera images (340756 bytes each) Experimentally, an array of up to 94 (not 95) Pictures is allowed However, the display of images requires that image data be copied, so display of many images may not work If a program hangs when working with \hyperlink{struct_picture}{Picture} variables, the issue may involve lack of space on the runtime stack. To utilize a modest number of Pictures, use \char`\"{}ulimit -\/s\char`\"{} command, as needed, in a terminal window For example, ulimit -\/s 32768 Sizes above 32768 may not be allowed in Linux or Mac OS X Use the camera to take a photo 
\end{DoxyWarning}
\begin{DoxyReturn}{Returns}
\hyperlink{struct_picture}{Picture} 
\end{DoxyReturn}
\mbox{\Hypertarget{_myro_c_8h_a1b2462eb7a3149a89cfe73f39339ed89}\label{_myro_c_8h_a1b2462eb7a3149a89cfe73f39339ed89}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Turn\+Left@{r\+Turn\+Left}}
\index{r\+Turn\+Left@{r\+Turn\+Left}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Turn\+Left()}{rTurnLeft()}}
{\footnotesize\ttfamily void r\+Turn\+Left (\begin{DoxyParamCaption}\item[{double}]{speed,  }\item[{double}]{time }\end{DoxyParamCaption})}



turn Scribbler left for a specified time and speed 


\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move left linear range\+: -\/1.\+0 specifies right turn at full speed ~\newline
 0.\+0 specifies no turn ~\newline
 1.\+0 specifies left turn at full speed ~\newline
\\
\hline
{\em time} & specifies the duration of the turn ~\newline
 if negative\+: the robot starts to turn (non-\/blocking) other processing proceeds, and the robot continues to turn until given another motion command or disconnected (non-\/blocking) ~\newline
 if zero\+: robot starts turning (non-\/blocking); other processing proceeds ~\newline
 if positive\+: robot turns for the given duration, in seconds\\
\hline
\end{DoxyParams}
turn Scribbler left for a specified time and speed 
\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move left linear range\+: -\/1.\+0 specifies right turn at full speed 0.\+0 specifies no turn 1.\+0 specifies left turn at full speed \\
\hline
{\em time} & specifies the duration of the turn if negative\+: robot continues to turn until given another motion command or disconnected (non-\/blocking) if nonnegative\+: robot turns for the given duration, in seconds \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_a0c3496dd17992e9788110c15c017e566}\label{_myro_c_8h_a0c3496dd17992e9788110c15c017e566}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Turn\+Right@{r\+Turn\+Right}}
\index{r\+Turn\+Right@{r\+Turn\+Right}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Turn\+Right()}{rTurnRight()}}
{\footnotesize\ttfamily void r\+Turn\+Right (\begin{DoxyParamCaption}\item[{double}]{speed,  }\item[{double}]{time }\end{DoxyParamCaption})}



turn Scribbler right for a specified time and speed 


\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move right ~\newline
 linear range\+: -\/1.\+0 specifies left turn at full speed ~\newline
 0.\+0 specifies no turn ~\newline
 1.\+0 specifies right turn at full speed \\
\hline
{\em time} & specifies the duration of the turn ~\newline
 if negative\+: the robot starts to turn (non-\/blocking) other processing proceeds, and the robot continues to turn until given another motion command or disconnected (non-\/blocking) ~\newline
 if zero\+: robot starts turning (non-\/blocking); other processing proceeds ~\newline
 if positive\+: robot turns for the given duration, in seconds ~\newline
 if nonnegative\+: robot turns for the given duration, in seconds\\
\hline
\end{DoxyParams}
turn Scribbler right for a specified time and speed 
\begin{DoxyParams}{Parameters}
{\em speed} & the rate at which the robot should move right linear range\+: -\/1.\+0 specifies left turn at full speed 0.\+0 specifies no turn 1.\+0 specifies right turn at full speed \\
\hline
{\em time} & specifies the duration of the turn if negative\+: robot continues to turn until given another motion command or disconnected (non-\/blocking) if nonnegative\+: robot turns for the given duration, in seconds \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{_myro_c_8h_aa1a97cc92ee785afb8af4e248d08cbb9}\label{_myro_c_8h_aa1a97cc92ee785afb8af4e248d08cbb9}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Turn\+Speed@{r\+Turn\+Speed}}
\index{r\+Turn\+Speed@{r\+Turn\+Speed}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Turn\+Speed()}{rTurnSpeed()}}
{\footnotesize\ttfamily void r\+Turn\+Speed (\begin{DoxyParamCaption}\item[{char $\ast$}]{direction,  }\item[{double}]{speed,  }\item[{double}]{time }\end{DoxyParamCaption})}



turn Scribbler in direction for a specified time and speed 


\begin{DoxyParams}{Parameters}
{\em direction} & direction of turn, based on looking from the center of the robot and facing forward \\
\hline
{\em speed} & the rate at which the robot should move forward ~\newline
 linear range\+: -\/1.\+0 specifies turn at full speed ~\newline
 0.\+0 specifies no turn ~\newline
 1.\+0 specifies turn at full speed \\
\hline
{\em time} & specifies the duration of the turn ~\newline
 if negative\+: the robot starts to turn (non-\/blocking) other processing proceeds, and the robot continues to turn until given another motion command or disconnected (non-\/blocking) ~\newline
 if zero\+: robot starts turning (non-\/blocking); other processing proceeds ~\newline
 if positive\+: robot turns for the given duration, in seconds \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
direction is \char`\"{}left\char`\"{} or \char`\"{}right\char`\"{}, case insensitive
\end{DoxyPrecond}
turn Scribbler in direction for a specified time and speed 
\begin{DoxyParams}{Parameters}
{\em direction} & direction of turn, based on looking from the center of the robot and facing forward \\
\hline
{\em speed} & the rate at which the robot should move forward linear range\+: -\/1.\+0 specifies turn at full speed 0.\+0 specifies no turn 1.\+0 specifies turn at full speed \\
\hline
{\em time} & specifies the duration of the turn if negative\+: robot continues to turn until given another motion command or disconnected if nonnegative\+: robot turns for the given duration, in seconds \\
\hline
\end{DoxyParams}
\begin{DoxyPrecond}{Precondition}
direction is \char`\"{}left\char`\"{} or \char`\"{}right\char`\"{}, case insensitive 
\end{DoxyPrecond}
\mbox{\Hypertarget{_myro_c_8h_a820ec009f1e2a6b8cf701301f79107a5}\label{_myro_c_8h_a820ec009f1e2a6b8cf701301f79107a5}} 
\index{Myro\+C.\+h@{Myro\+C.\+h}!r\+Wait\+Timed\+Image\+Display@{r\+Wait\+Timed\+Image\+Display}}
\index{r\+Wait\+Timed\+Image\+Display@{r\+Wait\+Timed\+Image\+Display}!Myro\+C.\+h@{Myro\+C.\+h}}
\subsubsection{\texorpdfstring{r\+Wait\+Timed\+Image\+Display()}{rWaitTimedImageDisplay()}}
{\footnotesize\ttfamily void r\+Wait\+Timed\+Image\+Display (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Wait until all timed, non-\/blocking image window timers are complete. 

\begin{DoxyPostcond}{Postcondition}
wait until all timed \mbox{[}non-\/blocking\mbox{]} images have closed ~\newline
 robot motion is unaffected by this function
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
images opened with duration 0.\+0 do not close until images are updated or until the program terminates ~\newline
 all other \mbox{[}timed, non-\/blocking\mbox{]} image windows are closed by this function
\end{DoxyWarning}
\begin{DoxyPostcond}{Postcondition}
wait until all timed \mbox{[}non-\/blocking\mbox{]} images have closed ~\newline
 robot motion is unaffected by this function
\end{DoxyPostcond}
\begin{DoxyWarning}{Warning}
images opened with duration 0.\+0 do not close until images are updated or until the program terminates ~\newline
 all other image windows are closed by this function 
\end{DoxyWarning}
