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 #208 background imageLoading...
Page #208 background image
import java.io.;
import java.util.;
import javax.comm.;
public class Download {
public static void main (String[] args) {
String filename = args[args.length - 1];
String portName = "COM1";
for (int i = 0; i < args.length - 2; i++) {
if (args[i].equals("-port")) portName = args[i + 1];
}
try { new Download (filename, portName); }
catch (NoSuchPortException nspe) {
System.out.println("Sorry, I don't know about the " +
portName + " port. ");
}
catch (PortInUseException piue) {
System.out.println("Sorry, somebody else is using " +
portName + ".");
}
catch (UnsupportedCommOperationException ucoe) {
System.out.println(ucoe);
}
catch (IOException ioe) {
System.out.println("An IOException occurred: " + ioe);
}
}
private SerialPort mPort;
private Reader mFileIn;
private Writer mOut;
private PortListener mPortListener;
private static final int kCharSleep = 20;
Page 237
private static final int kTimeOut = 800;
public Download(String filename, String portName)
throws NoSuchPortException, PortInUseException,
UnsupportedCommOperationException, IOException {
initialize(portName);
mFileIn = new FileReader (filename);
run();
}
protected void initialize(String portName)
throws NoSuchPortException, PortInUseException,
UnsupportedCommOperationException, IOException {
CommPortIdentifier id =
CommPortIdentifier.getPortIdentifier(portName);
mPort = (SerialPort)id.open("Download", 1000);

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