Package lejos.util

Examples of lejos.util.TextMenu.select()


        NXTCommConnector[] connectors = {Bluetooth.getConnector(), USB.getConnector(), RS485.getConnector()};
        int[] modes = {NXTConnection.PACKET, NXTConnection.RAW};

        int connectionType = connectionMenu.select();
        LCD.clear();
        int mode = modeMenu.select();
        while (true)
        {
            LCD.clear();
            LCD.drawString("Type: " + connectionStrings[connectionType], 0, 0);
            LCD.drawString("Mode: " + modeStrings[mode], 0, 1);
View Full Code Here


          LCD.clear();
          LCD.drawString("Found",6,0);
          LCD.drawString(names[selected],0,1);
          LCD.drawString(btrd.getBluetoothAddress(), 0, 2);
          //Menu 2: Show GPS Device
          int subSelection = subMenu.select();
          if (subSelection == 0){
            GPSDetected = true;
            GPSDevice = btrd;
            break;
          }
View Full Code Here

    {
        String[] connectionStrings = new String[]{"Bluetooth", "USB", "RS485"};
        TextMenu connectionMenu = new TextMenu(connectionStrings, 0, "Connection");
        NXTCommConnector[] connectors = {Bluetooth.getConnector(), USB.getConnector(), RS485.getConnector()};

        int connectionType = connectionMenu.select();
        LCD.clear();
        LCD.clear();
        LCD.drawString("Type: " + connectionStrings[connectionType], 0, 0);
        LCD.drawString("Running...", 0, 1);
        Responder resp = new Responder(connectors[connectionType]);
View Full Code Here

        int portNo = portMenu.select();
        if (portNo < 0) return;
        for(;;)
        {
            ColorLightSensor cs = new ColorLightSensor(SensorPort.PORTS[portNo], ColorLightSensor.TYPE_COLORNONE);
            int mode = modeMenu.select();
            if (mode < 0) return;
            cs.setType(ColorLightSensor.TYPE_COLORFULL + mode);
            LCD.clear();
            while (!Button.ESCAPE.isPressed())
            {
View Full Code Here

        NXTCommConnector[] connectors = {Bluetooth.getConnector(), RS485.getConnector()};
        int[] modes = {NXTConnection.PACKET, NXTConnection.RAW};

        int connectionType = connectionMenu.select();
        LCD.clear();
        int mode = modeMenu.select();

        LCD.clear();
        LCD.drawString("Name: " + name, 0, 0);
        LCD.drawString("Type: " + connectionStrings[connectionType], 0, 1);
        LCD.drawString("Mode: " + modeStrings[mode], 0, 2);
View Full Code Here

    TextMenu fileMenu = new TextMenu(fileNames,1);
   
    // Play files until the user quits
    int selected;
    do {
      selected = fileMenu.select();
      if (selected >= 0) {
        Sound.playSample(files[selected],100);
      }
    } while (selected >= 0);
View Full Code Here

        // Get the type of communications to be used
        String[] connectionStrings = new String[]{"Bluetooth", "RS485"};
        TextMenu connectionMenu = new TextMenu(connectionStrings, 0, "Connection");
        NXTCommConnector[] connectors = {Bluetooth.getConnector(), RS485.getConnector()};

        int connectionType = connectionMenu.select();

        // Now connect
        try {
            LCD.clear();
            LCD.drawString("Connecting...",0,0);
View Full Code Here

       "Msg 1", "Msg 2", "Msg 3"}
    TextMenu menu = new TextMenu(menuItems,1,"RCX Remote");   
    int menu_item;
   
    do {
      menu_item = menu.select();
     
      if (menu_item >= 0 && menu_item <= 4) {
        link.runProgram(menu_item + 1);
      }
     
View Full Code Here

        }
       
        for(;;)
        {       
          LCD.clear();
          int op = operation.select();         
          if (op < 0)
          {
            Button.ESCAPE.waitForPressAndRelease();
            break;
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.