Source
stringclasses
1 value
Date
int32
2.01k
2.01k
Text
stringlengths
3
15.9M
Token_count
int32
1
2.44M
github-java-corpus
2,012
package lejos.nxt; public class FlashError extends Error { public FlashError() { super(); } public FlashError(String message) { super(message); } }
38
github-java-corpus
2,012
package lejos.nxt; import lejos.robotics.Colors; import lejos.robotics.LampLightDetector; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * This class is used to obtain reading...
1,044
github-java-corpus
2,012
package lejos.nxt; import java.io.IOException; /** * Read and write access to flash memory in pages. * * @author Lawrie Griffiths. * */ public class Flash { /** * Maximum number of pages available to user flash memory. * This value is obtained automatically from the firmware. * */ public static ...
384
github-java-corpus
2,012
package lejos.nxt; /** * * Abstraction for a NXT output port. * */ public class MotorPort implements TachoMotorPort { int _id; int _pwmMode = PWM_FLOAT; // default to float mode private MotorPort(int id) { _id = id; } /** * MotorPort A. */ public static final MotorPort A = new MotorPort ('A'); ...
469
github-java-corpus
2,012
package lejos.nxt; import java.util.Iterator; /** * This class provides access to many of the internal structures of the leJOS * virtual machine. In particular it provides Java level access to the classes, * methods fields etc. that make up the currently executing program. These * structures are used by the VM to...
7,935
github-java-corpus
2,012
package lejos.nxt; import java.util.Properties; /** * leJOS NXJ persistent settings. * * @author Lawrie Griffiths * */ public class Settings { private static Properties props; /** * Get the value for a leJOS NXJ persistent setting * @param key the name of the setting * @param defaul...
352
github-java-corpus
2,012
/** * NXT access classes. */ package lejos.nxt; /** * Provides blocking access to events from the NXT. Poll is a bit * of a misnomer (since you don't 'poll' at all) but it takes its * name from the Unix call of the same name. */ public class Poll { public static final short SENSOR1_MASK = 0x01; public st...
703
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Error messages that can be returned after a call to the NXT brick. * e.g. The return value comes from ...
795
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.*; import lejos.robotics.TachoMotor; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Motor class. Contains three instances of Motor. ...
2,208
github-java-corpus
2,012
package lejos.nxt.remote; import lejos.nxt.*; import java.io.*; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Supports a motor connected to a remote NXT * * @author La...
473
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.*; import java.util.ArrayList; import lejos.nxt.comm.*; /** * Provides an API similar to the leJOS API for accessing * motors, sensors etc. on a remote NXT accessed over * Bluetooth using LCP. * */ public class RemoteNXT { private NXTCommand nxtCommand = new...
2,465
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Represents a remote NXT accessed via LCP. * */ public class DeviceInfo { public byte status; pu...
97
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Container for holding the output state values. * * @author <a href="mailto:bbagnall@mts.net">Brian ...
303
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Firmware information for a remote NXT accessed via LCP. * */ public class FirmwareInfo { public b...
89
github-java-corpus
2,012
package lejos.nxt.remote; import lejos.nxt.*; import java.io.*; /** * Emulates a Sensor Port using LCP */ public class RemoteSensorPort implements NXTProtocol, ADSensorPort, I2CPort { private int id; private int type, mode; private NXTCommand nxtCommand; public RemoteSensorPort(NXTCommand nxtComma...
1,181
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.*; import lejos.nxt.comm.*; /** * * Initiates communication to a remote NXT. Used by NXTCommand * to implement the Lego Communications Protocol (LCP) over Bluetooth. * */ public class NXTComm implements NXTCommRequest { private NXTConnection con; privat...
343
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.*; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Battery readings from a remote NXT. */ public class RemoteBattery implements NXT...
255
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.UnsupportedEncodingException; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Methods to encode and decode ASCIIZ. * ASCIIZ is ASCII...
430
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Structure that gives information about a leJOS NXJ file. * */ public class FileInfo { /** * The name of t...
195
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Sensor input values for a remote NXT accessed via LCP. * * @author <a href="mailto:bbagnall@mts.net...
296
github-java-corpus
2,012
package lejos.nxt.remote; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * LEGO Communication Protocol constants. * */ public interface NXTProtocol { // Command types const...
1,542
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.*; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Sends LCP requests to the NXT and receives replies. * Uses an object that impleme...
8,009
github-java-corpus
2,012
package lejos.nxt.remote; import java.io.*; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Interface that all NXTComm implementation classes must implement for low-level comm...
184
github-java-corpus
2,012
package lejos.nxt; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * An abstraction for a port that supports Analog/Digital sensors. * * @author Lawrie Griffiths. * */ public interfa...
110
github-java-corpus
2,012
package lejos.nxt; import lejos.util.Delay; /** * Abstraction for an NXT button. * Example:<p> * <code><pre> * Button.ENTER.waitForPressAndRelease(); * Sound.playTone (1000, 1); * </pre></code> */ public class Button implements ListenerCaller { public static final int ID_ENTER = 0x1; public static fin...
1,710
github-java-corpus
2,012
package lejos.nxt; import lejos.robotics.Colors; import lejos.util.Delay; /** * Abstraction for a NXT input port. * */ public class SensorPort implements LegacySensorPort, I2CPort, ListenerCaller { /** * Power types. */ public static final int POWER_STD = 0; public static final int POWER_RCX...
8,410
github-java-corpus
2,012
package lejos.nxt.rcxcomm; import lejos.nxt.*; import lejos.nxt.addon.*; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Emulates RCX LLC class using the RCXLink class. * ...
742
github-java-corpus
2,012
package lejos.nxt.rcxcomm; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import lejos.util.Delay; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. *...
1,330
github-java-corpus
2,012
package lejos.nxt.rcxcomm; import lejos.nxt.*; import java.io.IOException; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * RCXPort provides an interface similar to java.net....
255
github-java-corpus
2,012
package lejos.nxt.rcxcomm; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Abstract packet handler. * Implementations must include sendPacket, receivePacket and * isPacketAv...
491
github-java-corpus
2,012
package lejos.nxt.rcxcomm; import lejos.nxt.*; import lejos.util.Delay; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Packet handler than implement the LLC packet protocol....
768
github-java-corpus
2,012
package lejos.nxt.rcxcomm; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Opcode constants. * */ public interface Opcode { public static final byte OPCODE_MASK = (byte...
1,975
github-java-corpus
2,012
package lejos.nxt.rcxcomm; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * A Packet handler that guarantees reliable delivery using checksums, * acks, and a single bit sequence...
816
github-java-corpus
2,012
package lejos.nxt.rcxcomm; import lejos.nxt.*; import lejos.nxt.addon.*; import lejos.util.Delay; /* * WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. * DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT. */ /** * Emulation of the RCX Serial...
1,702
github-java-corpus
2,012
package lejos.nxt; /** * Abstraction for the local NXT Device. * Supports methods that are non specific to any particular sub-system. * * @author Lawrie Griffiths * */ public class NXT { /** * Terminate the application. */ public static native void exit(int code); /** * Shutdow...
332
github-java-corpus
2,012
package lejos.nxt; import lejos.robotics.TachoMotor; import lejos.util.Delay; /** * Abstraction for a NXT motor. Three instances of <code>Motor</code> * are available: <code>Motor.A</code>, <code>Motor.B</code> * and <code>Motor.C</code>. To control each motor use * methods <code>forward, backward, reverseDirecti...
4,340
github-java-corpus
2,012
package lejos.nxt; /** * * Interface for monitoring changes to the value for an * Analogue/Digital sensor (such as a Touch, Light or Sound sensor) * on a SensorPort. * */ public interface SensorPortListener { /** * Called when the raw value of the sensor attached to the port changes. * @param aS...
135
github-java-corpus
2,012
import lejos.nxt.*; /** * This is a test of remote reading of sensors from the PC * using the iCommand equivalent classes in pccomm.jar * * @author Lawrie Griffiths * */ public class SensorTest { public static void main(String[] args) { LightSensor light = new LightSensor(SensorPort.S1); SoundS...
209
github-java-corpus
2,012
import lejos.pc.comm.*; import java.io.*; /** * This is a PC sample. It connects to the NXT, and then * sends an integer and waits for a reply, 100 times. * * Compile this program with javac (not nxjc), and run it * with java. * * You need pccomm.jar on the CLASSPATH and the jfantom.dll * DLL or liblibnxt....
423
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.remote.NXTCommand; import lejos.pc.comm.*; /** * Sample to spin motors and output Tachometer counts. * This sample shows how to control which NXT to connect to and switch on full logging. * * @author Lawrie Griffiths and Brian Bagnall * */ public class TachoCount ...
340
github-java-corpus
2,012
import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.*; import javax.swing.*; /** * This PC sample works with the leJOS NXJ sample, SocketTest. * * It shows you how to connect a program running on the NXT to a TCP/IP server * on your PC, intranet on the Internet. The host progra...
675
github-java-corpus
2,012
import lejos.pc.comm.*; import java.io.*; /** * This is a PC sample. It connects to the NXT, and then * sends an integer and waits for a reply, 100 times. * * Compile this program with javac (not nxjc), and run it * with java. * * You need pccomm.jar and bluecove.jar on the CLASSPATH. * On Linux, you will ...
452
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.*; /** * Test of remote access to Acceleration (Tilt) sensor using * iCommand-like classes in pccomm.jar. * * @author Lawrie Griffiths * */ public class AccelDemo { public static void main(String [] args) throws Exception { TiltSensor a = new TiltSensor(...
212
github-java-corpus
2,012
/** * GUI application for remote control of a NXT running RCNavigator<br> * Distance in meters <br> * uses RCNavComms class for bluetooth communications * used Command enum in this project * @author Roger Glassey */ public class RCNavigationControl extends javax.swing.JFrame { private static final long seri...
3,186
github-java-corpus
2,012
/** * Use this enum in both the RCNavigationControl program on the PC * and the RCNavigator that runs on the NXT * @author Roger Glassey */ public enum Command { GOTO,TRAVEL,ROTATE; // 3 commands to be tansmittes to the NXT }
68
github-java-corpus
2,012
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import lejos.pc.comm.*; /** * Provides Bluetooth communications services to RCNavitationControl:<br> * 1. connect to NXT * 2. send commands using the Comm...
876
github-java-corpus
2,012
package lejos.pc.tools; import java.io.*; import java.net.*; import js.tinyvm.TinyVMException; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.GnuParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; impo...
2,141
github-java-corpus
2,012
package lejos.pc.tools; public interface ConsoleViewerUI { public void append(String value); public void updateLCD(byte[] buffer); public void setStatus(String msg); public void logMessage(String msg); public void connectedTo(String name, String address); }
53
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.NXTCommLogListener; /** * * @author scholz * listener for log events that arise in pctools */ public interface ToolsLogListener extends NXTCommLogListener { }
52
github-java-corpus
2,012
package lejos.pc.tools; import java.io.*; import lejos.nxt.remote.*; import lejos.pc.comm.*; /** * Utility class used by the nxj and nxjupload command line tools. * It checks the file, connects to the NXT, uploads the file, optionally runs it, * and disconnects. This class is also used by the Eclipse plugin. * ...
603
github-java-corpus
2,012
package lejos.pc.tools; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import javax.swing.plaf.metal.*; import javax.swing.JComponent; /** * Swing Gauge Component for displaying the value of a NXT sensor. * * @author Lawrie Griffiths * */ public class Gauge extends JCo...
691
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.*; import lejos.nxt.remote.*; import java.awt.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.TableColumn; import javax.swing.border.*; import java.awt.event.*; import java.io.*; import java.text.NumberFormat; /** * * Graphical control cent...
11,753
github-java-corpus
2,012
package lejos.pc.tools; import js.tinyvm.TinyVMException; import js.tinyvm.util.TinyVMCommandLineParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.ParseException; /** * CommandLineParser */ public class NXJCommandLineParser extends TinyVMCommandLineParser { public NXJCommandLineParser() ...
358
github-java-corpus
2,012
package lejos.pc.tools; import java.awt.*; import java.awt.Dimension; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.image.BufferedImage; /** * Downloads data from the RConsole running on a NXT <br> * Uses USB by default, or Bluetooth if selected from...
1,720
github-java-corpus
2,012
package lejos.pc.tools; import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.JLabel; import javax.swing.JPanel; /** * A Swing JPanel that displays a gauge with a label * * @author Lawrie Griffiths */ public class LabeledGauge extends JPanel { private static final long serialV...
311
github-java-corpus
2,012
package lejos.pc.tools; import java.io.IOException; import lejos.nxt.remote.*; import javax.swing.table.AbstractTableModel; /** * Swing Table Model for manipulating NXT files. * * @author Lawrie Griffiths */ public class ExtendedFileModel extends AbstractTableModel { private static final long seria...
1,029
github-java-corpus
2,012
package lejos.pc.tools; public class NXJUploadException extends Exception { private static final long serialVersionUID = -7605663541720174844L; public NXJUploadException() { super(); } public NXJUploadException(String arg0) { super(arg0); } public NXJUploadException(Throwable arg0) { sup...
140
github-java-corpus
2,012
package lejos.pc.tools; import java.io.*; import js.tinyvm.TinyVMException; import org.apache.commons.cli.*; import lejos.pc.comm.*; /** * Console output monitor class. * This class provides access to console output from a NXT program. The program * simply writes strings using the NXT RConsole class. These are sen...
811
github-java-corpus
2,012
package lejos.pc.tools; public class ToolsLogger implements ToolsLogListener { public void logEvent(String message) { System.out.println("leJOS NXJ> " + message); } public void logEvent(Throwable throwable) { System.err.println("leJOS NXJ> " + throwable.getMessage()); } }
67
github-java-corpus
2,012
/** * Command to write the leJOS Virtual Machine and Menu system to the NXT Flash. */ package lejos.pc.tools; import lejos.pc.comm.*; import java.io.*; import java.io.PrintWriter; import java.io.StringWriter; import js.tinyvm.TinyVMException; import org.apache.commons.cli.CommandLine; import org.apache.commons.cl...
1,483
github-java-corpus
2,012
package lejos.pc.tools; import java.io.*; import lejos.pc.comm.*; public class DataViewComms { private NXTConnector con; private boolean connected = false; private DataViewerUI viewer; private OutputStream os; private DataInputStream dataIn; public DataViewComms(DataViewerUI view...
564
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.*; import org.apache.commons.cli.CommandLine; /** * Command-line utility to upload a linked binary to the NXT. * * @author Lawrie Griffiths * */ public class NXJUpload extends NXTCommLoggable { private NXJUploadCommandLineParser fParser; private Upload fUpload; /...
531
github-java-corpus
2,012
package lejos.pc.tools; import java.awt.Dimension; import javax.swing.*; /** * JPanel that displays two gauges: one for the raw and * one for the scaled value of a NXT sensor. * * @author Lawrie Griffiths */ public class SensorPanel extends JPanel { private static final long serialVersionUID = 35921...
510
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.*; import javax.swing.table.AbstractTableModel; /** * A table model for PC GUI programs. * This is used by NXJBrowser and NXJMonitor to allow the user to choose * which NXT to connect to. * * @author Lawrie Griffiths * */ public class NXTConnectionModel ...
659
github-java-corpus
2,012
package lejos.pc.tools; import java.io.PrintWriter; import java.io.StringWriter; import js.tinyvm.TinyVMException; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.GnuParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Optio...
565
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.*; import java.io.*; import javax.swing.*; import java.awt.*; /*** *GUI application to write the leJOS Virtual Machine and Menu system to the NXT * Flash. Created on August 15, 2008, 9:36 AM revised Nov 10, 2008 to run with * Java 5 Author Roger Glassey based on Andy S...
1,547
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.*; import lejos.nxt.remote.*; import java.io.*; /** * Class to allow the updating and verification of the leJOS firmware. * * @author andy */ public class NXJFlashUpdate { private static final int MAX_FIRMWARE_PAGES = 368; private static final int T...
3,106
github-java-corpus
2,012
package lejos.pc.tools; import java.io.PrintWriter; import java.io.StringWriter; import js.tinyvm.TinyVMException; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.GnuParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Optio...
488
github-java-corpus
2,012
package lejos.pc.tools; public interface DataViewerUI { public void append(float value); public void showMessage(String msg); public void logMessage(String msg); public void setStatus(String msg); public void connectedTo(String name, String address); }
53
github-java-corpus
2,012
package lejos.pc.tools; /** * Interface to provide a notification UI mechanism for the flash update process. * @author andy */ public interface NXJFlashUI { /** * Report the progress of an ongoing operation. * @param msg Message about the operation * @param percent percentage complete....
107
github-java-corpus
2,012
package lejos.pc.tools; import java.io.*; import lejos.pc.comm.*; /** * Contains the logic for connecting to RConsole on the NXT and downloading data. * Can be used by different user interfaces. * * @author Roger Glassey and Lawrie Griffiths * */ public class ConsoleViewComms { private InputS...
914
github-java-corpus
2,012
package lejos.pc.tools; import lejos.pc.comm.*; import lejos.nxt.remote.*; import java.awt.*; import javax.swing.*; import javax.swing.table.*; import org.apache.commons.cli.CommandLine; import java.awt.event.*; import java.io.*; /** * * Graphical file browser for leJOS NXJ. * Supports uploading,, downloading...
2,134
github-java-corpus
2,012
package lejos.pc.tools; import java.awt.*; import java.awt.event.*; import java.text.NumberFormat; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; /** * Downloads data from the DataLogger running on a NXT <br> * Uses Bluetooth or USB<br> * To use...
1,410
github-java-corpus
2,012
package lejos.pc.tools; import js.common.CLIToolProgressMonitor; import js.common.ToolProgressMonitor; import js.tinyvm.TinyVM; import lejos.pc.comm.*; /** * * Command-line utility that links and uploads NXJ programs in one call * * @author Lawrie Griffiths * */ public class NXJLinkAndUpload extends NXTCommL...
877
github-java-corpus
2,012
package lejos.pc.tools; import java.awt.*; import java.awt.event.*; import lejos.nxt.remote.*; import javax.swing.*; import javax.swing.border.*; import lejos.pc.comm.*; import java.io.*; /** * Monitors sensors and motors of NXT using LCP. * * @author Lawrie Griffiths * */ public class NXJMoni...
2,170
github-java-corpus
2,012
package org.lejos.example; import lejos.nxt.*; /** * Example leJOS Project with an ant build file * */ public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); Button.waitForPress(); } }
56
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.*; import java.awt.Rectangle; /** * For testing the Mindsensors NXTCam. * @author Lawrie Griffiths */ public class NXTCamTest { final static int INTERVAL = 1000; // milliseconds public static void main(String [] args) throws Exception { NXTCam camera ...
343
github-java-corpus
2,012
import java.io.PrintStream; import java.util.Random; import lejos.robotics.proposal.DifferentialPilot; import lejos.util.KalmanFilter; import lejos.util.Matrix; import lejos.nxt.*; import lejos.nxt.comm.RConsole; /** * Kalman Filter example. * * A pilot robot with an ultrasonic sensor facing * forwar...
894
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.*; import lejos.util.*; /** * Example created to test Lattebox NXTe Kit * * this example manage 2 RC Servos connected to NXTe * * @author Juan Antonio Brenha Moral */ public class LatteboxTest{ private static NXTe NXTeObj; private static DebugMessages...
840
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.*; import lejos.nxt.rcxcomm.*; /* * Responds to RCX Remote control * */ public class RCXEmulator { public static void main(String[] args) { Serial.setPort(SensorPort.S1); RCXLink link = Serial.getLink(); int msgCount=0; link.setDefaultSpeed(); l...
1,111
github-java-corpus
2,012
import lejos.nxt.*; /** * Simple test of leJOS exceptions. * * This causes an ArrayIndexOutOdBoundsException. * * Use the --verbose (-v) flag on nxj or nxjlink to see * the values of classes and methods (signatures) for * your program. * * @author Lawrie Griffiths * */ public class ExceptionTest { pub...
113
github-java-corpus
2,012
import java.lang.System; import lejos.nxt.*; /** * This program tests the performance with and without Listeners, * speed as well as memory efficiency. * Press Run repeatedly to obtain 8 values * (the number of the value is shown in the program number): * * 1/3/5/7: time in ms for empty for loop of 10000 iterati...
820
github-java-corpus
2,012
import java.awt.Rectangle; import java.io.PrintStream; import java.util.Collection; import lejos.geom.Line; import lejos.nxt.Button; import lejos.nxt.Motor; import lejos.nxt.SensorPort; import lejos.nxt.UltrasonicSensor; import lejos.nxt.comm.RConsole; import lejos.robotics.Pose; import lejos.robotics.RangeRe...
1,596
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.*; /** * Test of a remote RCX motor using a remote RCX as a controller. * * Requires a Mindsensors NRLink adapter connected to sensor * port S1 on the NXT, and RCX motors connected to one or * more of the RCX motor ports. * * Press the ENTER button to inc...
528
github-java-corpus
2,012
import lejos.nxt.rcxcomm.*; import java.io.*; import lejos.nxt.*; /** * Test of NXT emulation of the leJOS RCX RCXPort class. * * Run the LLCSensorReader sample on the RCX, and the NXT * will read the raw sensor value of the sensor connected to * the RCX S2 port. * * Requires a Mindsensors NRLin...
359
github-java-corpus
2,012
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import lejos.nxt.*; import lejos.nxt.comm.BTConnection; import lejos.nxt.comm.Bluetooth; import lejos.robotics.navigation.*; /** *Example of a navigating robot operating under remote control * uses Command enum to de...
698
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.comm.*; /** * BlueStats: display local device Bluetooth information. * * @author Lawrie Griffiths * */ public class BlueStats { public static void main(String[] args) { String versionString = "BC4 version "; String nameString = "Name"; String visString = "...
471
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.comm.*; import java.io.*; /** * Receive data from another NXT, a PC, a phone, * or another bluetooth device. * * Waits for a connection, receives an int and returns * its negative as a reply, 100 times, and then closes * the connection, and waits for a new one. * * @auth...
310
github-java-corpus
2,012
import lejos.nxt.*; public class I2CDevices { public static void main(String[] args) throws Exception { I2CSensor[] sensors = { new I2CSensor(SensorPort.S1), new I2CSensor(SensorPort.S2), new I2CSensor(SensorPort.S3), new I2CSensor(SensorPort.S4)}; while (!Button.ESCAPE.isPresse...
218
github-java-corpus
2,012
import lejos.nxt.*; import lejos.robotics.navigation.*; /** * Test of the Pilot class. * * Requires a wheeled vehicle with two independently controlled * motors to steer differentially, so it can rotate within its * own footprint (i.e. turn on one spot). * * Adjust the parameters of the Pilot to the dimensio...
566
github-java-corpus
2,012
import lejos.nxt.*; import lejos.robotics.subsumption.*; import lejos.robotics.navigation.*; /** * Demonstration of use of the Behavior and Pilot classes to * implement a simple line following robot. * * Requires a wheeled vehicle with two independently controlled * wheels with motors connected to motor ports A ...
503
github-java-corpus
2,012
import lejos.nxt.*; import java.io.*; import java.lang.StringBuffer; /** * * Test of leJOS NXT File System. * * The example creates a file into leJOS NXT File System. * In this case the file, is a KML file used by Google Earth. * If you use the command nxjbrowse, you could * download that file and...
968
github-java-corpus
2,012
import lejos.nxt.*; import lejos.robotics.navigation.*; import java.util.Random; /** * BumpNavigator is a simple obstacle avoiding robot with a single destination. * Requires two touch sensors. * Since it relies on dead reckoning to keep track of its * location, the accuracy of navigation degrades with each obs...
675
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.ColorSensor; /** * For testing the HiTechnic color sensor (see lejos.nxt.addon.ColorSensor). * @author BB */ public class ColorDetector { final static int INTERVAL = 200; // milliseconds public static void main(String [] args) throws Exception { ColorSen...
299
github-java-corpus
2,012
import java.io.IOException; import lejos.nxt.*; import lejos.nxt.comm.*; import java.io.*; import javax.bluetooth.*; /** * * Test of NXT to NXT Bluetooth comms. * * Connects to another NXT, sends 100 ints, and receives the * replies. Then closes the connection and shuts down. * * Works with t...
665
github-java-corpus
2,012
import lejos.nxt.*; import lejos.util.TextMenu; import java.io.*; /** * Demonstrates playing 8-bit WAV files. * * Use nxjbrowse to upload 8-bit WAV files. On Windows XP, * ringin.wav and ringout.wav are 8-bit WAV file, * which can be found in the Media subfolder of * the Windows folder. * * @author Lawrie ...
457
github-java-corpus
2,012
import java.io.*; import java.util.Date; import javax.bluetooth.*; import javax.microedition.io.*; import javax.microedition.location.*; import lejos.addon.gps.*; import lejos.nxt.*; public class GPSInfo implements GPSListener { boolean doneInq = false; private static final int GPS_MAJOR = 0x1F00; ...
1,497
github-java-corpus
2,012
import java.io.*; import java.util.StringTokenizer; import javax.bluetooth.BluetoothStateException; import lejos.addon.keyboard.*; import lejos.nxt.*; /** * This is some sample code to demonstrate the Keyboard class if you have a Bluetooth * SPP Keyboard {@link lejos.addon.keyboard#Keyboard}. A simple com...
1,223
github-java-corpus
2,012
import lejos.nxt.*; import lejos.nxt.addon.*; /** * Simple test of compass sensors. * * Works with Mindsensors and HiTechnic compass sensors. * * @author Lawrie Griffiths * */ public class CompassTest { public static void main(String[] args) throws Exception { CompassSensor compass = new CompassSensor(S...
131
github-java-corpus
2,012
import lejos.nxt.*; import lejos.util.*; /** * Test of the DataLogger class. Logs 600 floating point * numbers and then transmits them to the PC. * * Run lejos.pc.tools.DataViewer on the PC to view the logged data. * * Once the program has transmitted data to the PC, it waits * for a button press. ...
264