- download -





Download: The package "rcxdirect"

<<  back

The package "rcxdirect"

This package supports the direct communication with the RCX-brick.

  • Example "RCXDirectTest.java"
  • Operating instructions:
    • Download "Direct-RCX" to your RCX-Brick (RCXDirectMode)
    • Place RCXDirectTest.java into the same directory as
      rcxtools.jar and RCXTools.properties
    • Compile: javac -classpath rcxtools.jar RCXDirectTest.java
    • Run: java -classpath .;rcxtools.jar RCXDirectTest

Classes and methods:

Class Battery

Method Summary
static float getVoltage()
           Returns the Battery voltage in Volt.
static int getVoltageInternal()
           Returns the Battery voltage.
static int getVoltageMilliVolt()
           Returns the Battery voltage in mV.


Class Motor

Field Summary
static Motor A
          Motor A.
static Motor B
          Motor B.
static Motor C
          Motor C.

Method Summary
 void backward()
          Causes motor to rotate backwards.
 void flt()
          Causes motor to float.
 void forward()
          Causes motor to rotate forward.
 int getPower()
          Returns the current motor power.
 void setPower(int aPower)
          Sets motor power to a value between 0 and 7.
 void stop()
          Causes motor to stop, pretty much instantaneously.


Class Motors

Method Summary
static void
control (int aMode, int bMode, int cMode,
int aPower, int bPower, int cPower)
           Sets motor direction for each motor to a value between 1 and 4 (1=forward, 2=backward, 3=stop, 4=float) and motor power to a value between 0 and 7


Class Port

Method Summary
static String getName()
           Returns the string representing the serial port
           that will be used to transfer data to the RCX.
static void setName(String aPortName)
          Sets the serial port that will be used to transfer data
          to the RCX, i.e. COM1, /dev/ttyS0.


Class Sensor

Field Summary
static Sensor S1
          Sensor labeled 1 on RCX.
static Sensor S2
          Sensor labeled 2 on RCX.
static Sensor S3
          Sensor labeled 3 on RCX.

Method Summary
 boolean readBooleanValue()
          Reads the boolean value of the sensor.
 int readRawValue()
          Reads the raw value of the sensor.
 int readValue()
          Reads the canonical value of the sensor.


Class Sound

Method Summary
static void beep()
          Beeps once.
static void beepSequence()
          Downward tones.
static void buzz()
          Low buzz.
static void systemSound(int aCode)
          Play a system sound.
static void twoBeeps()
          Beeps twice.