EasyManuals Logo

LEGO MINDSTORMS Robots User Manual

LEGO MINDSTORMS Robots
226 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #209 background imageLoading...
Page #209 background image
mPort.setSerialPortParams(
2400,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE
);
Reader in = new InputStreamReader(mPort.getInputStream());
mPortListener = new PortListener (in);
mOut = new OutputStreamWriter(mPort.getOutputStream());
}
public void run() {
int c, n = 1;
try {
sendReturn();
sendReturn();
while ((c = mFileIn.read()) != -1) {
if (c == '\r') {
sendReturn();
if (mPortListener.isComplete() == false) {
throw new DownloadException("Timed out waiting " +
"for a response from the RCX.");
}
else if (mPortListener.isError() == true) {
throw new DownloadException("Error: " +
mPortListener.getLastLine());
}
System.out.print(".");
n++;
}
else if (c != '\n') {
mPortListener.reset();
mOut.write(c);
mOut.flush();
Thread.sleep(kCharSleep);
}
}
sendReturn();
Page 238
sendReturn();
}
catch (InterruptedException ie) { System.out.println(ie) ; }
catch (DownloadException de) {
System.out.println();
System.out.println("Line " + n + ":");
System.out.println(" " + de.getMessage());
}
catch (IOException ioe) { System.out.println(ioe); }
// Regardless of what happened, try to clean up.
try {
mPortListener.stop();
mFileIn.close();
mOut.close();

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the LEGO MINDSTORMS Robots and is the answer not in the manual?

LEGO MINDSTORMS Robots Specifications

General IconGeneral
Product LineLEGO MINDSTORMS
CategoryToy
Age Range10+
Batteries RequiredYes
Memory64 MB RAM, 16 MB Flash
ConnectivityBluetooth, USB
SensorsTouch, Color, Gyro
Battery TypeAA
Interactive FeaturesProgrammable, Remote Control
App CompatibilityiOS, Android
ProcessorARM9
Pieces Count601
Battery Count6
App NameLEGO MINDSTORMS EV3 Programmer App

Related product manuals