import java.lang.System;
import josx.platform.rcx.*;
/**
* This program can be used to test each sensor and motor
* independently.
* Button functionality:
*
* - VIEW:
* Select a port.
* - PRGM:
* Sensor ports:
* select input type/mode: touch/raw (0), touch/bool (1), touch/edge (2),
* touch/pulse (3), light/pct (4), rot/angle (5),
* temp/degc (6), temp/degf (7)
* Motor ports : select power.
* - RUN:
* Sensor ports: passive (0), active (1).
* Motor ports : float (0), forward (1), backward (2), brake (3).
* Press longer than 0.5s to terminate the program.
*
* */
public class View
{
static final int QUIT_DELAY = 500 /* ms */;
static final PortView[] VIEWS =
new PortView[] { SensorView.S1, SensorView.S2, SensorView.S3,
MotorView.A, MotorView.B, MotorView.C };
static int iCurrentView;
static void viewPressed()
{
iCurrentView++;
if (iCurrentView >= VIEWS.length)
iCurrentView = 0;
}
static void prgmPressed()
{
VIEWS[iCurrentView].prgmPressed();
}
static void runPressed()
{
VIEWS[iCurrentView].runPressed();
}
static void show()
{
LCD.clear();
for( int i=0; i QUIT_DELAY)
quit = true;
else
runPressed();
}
}
show();
}
for( int i=0; i