Proxim RangeLAN2 7920 Bedienungsanleitung Seite 76

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 103
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 75
61
try {
sock = new Socket(ip, 2000);
cmdIn = new BufferedReader(new InputStreamReader(sock.getInputStream()));
cmdOut = sock.getOutputStream();
} catch (Exception ex) {
System.err.println("Could not connect to " + ip + ".\nQuitting.");
System.exit(0);
}
/***********************************************************************/
// GENERAL LAYOUT (Panel Assignments)
GridBagLayout gbl = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
//MANUAL CONTROL TAB
JPanel main = new JPanel(new BorderLayout());
//Sliders
JPanel controls = new JPanel(gbl);
//Buttons
JPanel butt = new JPanel(gbl);
GridBagLayout gblay = new GridBagLayout();
GridBagConstraints gbcon = new GridBagConstraints();
//AUTO-MODE TAB
JPanel autonomous = new JPanel(new BorderLayout());
//Lat, Long, & Heading
JPanel q = new JPanel(gblay);
//Robot Status
JPanel p = new JPanel(gblay);
//Navigation GPS
JPanel s = new JPanel(gblay);
/***********************************************************************/
/* This is the motor controller section. Control sliders are created for
the Left and Right Motor Speeds. Control Buttons are created for
movement and direction. */
/****************** CONTROL SLIDERS ********************/
//LEFT MOTOR SPEED ONLY
leftMotor = new JSlider(JSlider.HORIZONTAL, REVERSE, FORWARD, STOP);
leftMotor.addChangeListener(
new ChangeListener() {
public void stateChanged(ChangeEvent ev) {
int val = leftMotor.getValue();
try {
/* First variable x is a place holder, second variable is the motor designator:
L=0,R=1,B=2,S=3, val is the speed variable. */
cmdOut.write(("x,0," + val + ",\n").getBytes());
Seitenansicht 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 102 103

Kommentare zu diesen Handbüchern

Keine Kommentare