NOT regulated Motors

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

NOT regulated Motors

Postby Lego-3D-drucker » Mon Dec 24, 2012 2:56 pm

Hi,

We found how to "import" bluetooth connection from on class to the other !

But we have a last problem with the regulated Motors.
We want that, at the beginning of the programm, the motors ARENT regulated ! I mean, that if there is a obstacle, that they dont accelerate, and use more power!
We found a solution for the motors of the Master :
NXTMotor m1 = new NXTMotor(MotorPort.A)
but for the motors of the slaves it doesnt work !
We tried like this
NXTMotor m1 = new NXTMotor(MotorPort.A) (of course after the connection)
but it doesnt work !
Please help !
Marry Christmas :P

the code :

Code: Select all
NXTCommConnector connector = Bluetooth.getConnector();
      RemoteNXT cavin = new RemoteNXT("Cavin", connector);
      NXTMotor red = new NXTMotor(MotorPort.A);
      NXTMotor blue = new NXTMotor(cavin.A);
Lego-3D-drucker
New User
 
Posts: 8
Joined: Sun Dec 09, 2012 12:47 pm

Re: NOT regulated Motors

Postby TechnoX » Tue Jan 01, 2013 5:22 pm

Why don't you just write:
Code: Select all
import java.io.IOException;
import lejos.nxt.*;
import lejos.nxt.comm.*;

public class Program {

   public static void main(String[] args) throws InterruptedException, IOException {
      NXTCommConnector connector = Bluetooth.getConnector();
      System.out.println("Connecting...");
      RemoteNXT cavin= new RemoteNXT("cavin", connector);
      System.out.println("Connected");

      Motor.A.forward();
      cavin.A.forward();

      Button.waitForAnyPress();
   }
}
TechnoX
Novice
 
Posts: 51
Joined: Tue May 03, 2011 5:57 pm
Location: Sweden

Re: NOT regulated Motors

Postby gloomyandy » Tue Jan 01, 2013 5:29 pm

That will still use the remote motor as a regulated motor. It is not possible to use a motor in an unregulated mode with the RemoteNXT interface. If you really want to do this I would suggest that you run your own software on both NXTs and pass commands between them to carry out the operations.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NOT regulated Motors

Postby Lego-3D-drucker » Sat Jan 05, 2013 1:37 pm

Hello,

Thank you for the answer.
We made it so that we made at the beginning of the programm a Stream between the two NXTs.
So that is was possible to use the unregulated motors.
Then we simply closed the Streamand began tht RemoteNXT-connection.
Ty.
Code: Select all
import java.io.DataOutputStream;
import java.io.IOException;

import javax.bluetooth.RemoteDevice;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.Motor;
import lejos.nxt.SensorPort;
import lejos.nxt.Sound;
import lejos.nxt.TouchSensor;
import lejos.nxt.comm.BTConnection;
import lejos.nxt.comm.Bluetooth;
import lejos.nxt.comm.NXTCommConnector;
import lejos.nxt.remote.RemoteNXT;


class cavinC extends Thread {

   private int degree;
   private RemoteNXT cavin; // cavin

   public cavinC(int degree, RemoteNXT cavin) {
      this.degree = degree;
      this.cavin = cavin;
   }

   @Override
   public void run() {
      cavin.C.rotate(degree);
   }

}

class cavinB extends Thread {

   private int degree;
   private RemoteNXT cavin; // cavin

   public cavinB(int degree, RemoteNXT cavin) {
      this.degree = degree;
      this.cavin = cavin;
   }

   @Override
   public void run() {
      cavin.B.rotate(degree);
   }

}

public class Master {

   public static void main(String[] args) throws IOException,
         InterruptedException {
      // TODO Auto-generated method stub

      TouchSensor touch1 = new TouchSensor(SensorPort.S1); // Button
      TouchSensor touch2 = new TouchSensor(SensorPort.S2); // X-Axe stop
      // Initialization of all Axes in
      // order to begin always at the
      // // same place. (675/1050/0)
      System.out.println("Ready for the Initialisation");
      System.out.println("Waiting for any press.");
      Button.waitForAnyPress();
      LCD.clear();
      LCD.drawString("Connecting...", 0, 0);
      // Search all bluethooth-known devices. Define the known remote device
      // Cavin with the name cavin1.
      RemoteDevice cavin1 = Bluetooth.getKnownDevice("Cavin");
      // make bluetooth connection with cavin1
      BTConnection con1 = Bluetooth.connect(cavin1);
      LCD.clear();
      LCD.drawString("Connected", 0, 0);
      // Give the right to receive and send dates and define those two rights
      // (give names).
      DataOutputStream out = con1.openDataOutputStream();
      // define new NO REGULATED motors

      Motor.B.setSpeed(500);
      Motor.B.forward();
      while (!touch2.isPressed()) {
      }
      Motor.B.stop();
      Motor.B.setSpeed(1000);
      Motor.B.rotate(-727);
      long time = System.currentTimeMillis();
      while (!touch1.isPressed() && System.currentTimeMillis() < time + 11000) {
      }
      Sound.beep();
      out.writeInt(1300);
      out.flush();
      Sound.beep();
      Thread.sleep(5000);
      time = System.currentTimeMillis();
      while (!touch1.isPressed() && System.currentTimeMillis() < time + 22000) {
      }
      Sound.beep();
      out.writeInt(0);
      out.flush();
      Thread.sleep(5000);
      out.close();
      con1.close();
      NXTCommConnector connector = Bluetooth.getConnector();
      RemoteNXT cavin = new RemoteNXT("Cavin", connector);
      cavin.A.setSpeed(1000);
      cavin.A.rotate(-285);
      int Rx = 675, Ry = 1050, Rz = 130;

      boolean go1 = true;
      while (go1) {
         LCD.clear();
         System.out.println("Please select your Objekt with the buttons");
         Button.waitForAnyPress();
         int nbfigure = 3;
         int figure = 0;
         String form = "default";
         while (Button.ENTER.isUp()) {
            if (Button.RIGHT.isDown()) {
               figure++;
               while (Button.RIGHT.isDown()) {
               }
               LCD.clear();

            } // 2<-- -1 | 0 1 2 | 3--> 0
            else if (Button.LEFT.isDown()) {
               figure--;
               while (Button.LEFT.isDown()) {
               }
               LCD.clear();

            }
            if (figure == nbfigure) {
               figure = 0;
            } else if (figure == -1) {
               figure = nbfigure - 1;
            }
            switch (figure) {
            case 0: {
               Graphics g = new Graphics();
               Image image1 = new Image(64, 64, new byte[] { (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0xc0, (byte) 0xfc,
                     (byte) 0xe0, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0xff, (byte) 0xff,
                     (byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x40, (byte) 0xff, (byte) 0xd6,
                     (byte) 0x6d, (byte) 0xf2, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0xa0, (byte) 0x7f, (byte) 0xba, (byte) 0x5f,
                     (byte) 0xa5, (byte) 0x58, (byte) 0xb0, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x80, (byte) 0xbe,
                     (byte) 0x7e, (byte) 0xf7, (byte) 0xfe, (byte) 0xf7,
                     (byte) 0xfe, (byte) 0xff, (byte) 0x36, (byte) 0xde,
                     (byte) 0xe0, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x40, (byte) 0xc0,
                     (byte) 0xd8, (byte) 0xd2, (byte) 0xd6, (byte) 0x51,
                     (byte) 0x7c, (byte) 0xd7, (byte) 0xd0, (byte) 0x50,
                     (byte) 0xd0, (byte) 0xd7, (byte) 0xfe, (byte) 0xf3,
                     (byte) 0xd4, (byte) 0xd7, (byte) 0xd8, (byte) 0xc0,
                     (byte) 0xc0, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x80, (byte) 0x40, (byte) 0xb0,
                     (byte) 0xe8, (byte) 0x96, (byte) 0xdd, (byte) 0xd2,
                     (byte) 0xe9, (byte) 0xf6, (byte) 0x77, (byte) 0x3f,
                     (byte) 0x3b, (byte) 0x1f, (byte) 0x1f, (byte) 0x1f,
                     (byte) 0x1f, (byte) 0x1d, (byte) 0x1b, (byte) 0x3b,
                     (byte) 0x37, (byte) 0xf7, (byte) 0xef, (byte) 0xd5,
                     (byte) 0xe9, (byte) 0xbe, (byte) 0xc8, (byte) 0xe0,
                     (byte) 0xc0, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x38, (byte) 0x2c,
                     (byte) 0x2a, (byte) 0x2d, (byte) 0x2a, (byte) 0x2b,
                     (byte) 0x3a, (byte) 0x3d, (byte) 0x3f, (byte) 0x07,
                     (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x1f,
                     (byte) 0x1f, (byte) 0x1f, (byte) 0x24, (byte) 0x25,
                     (byte) 0x27, (byte) 0x25, (byte) 0x24, (byte) 0x24,
                     (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, });
               g.drawImage(image1, 0, 0, 0);
               form = "Eiffelturm";
               break;
            }

            case 1: {
               LCD.drawString("Objekt2", 0, 0);
               form = "Objekt2";
               break;
            }

            case 2:
               LCD.drawString("Objekt3", 0, 0);
               form = "Objekt3";
               break;

            }

         }

         Sound.beepSequenceUp();
         LCD.clear();
         System.out.println("Selectionnez une forme avec les flèches svp.");
         Button.waitForAnyPress();
         int color = 0;
         String colour = "rouge";// test
         while (!Button.ENTER.isDown()) {
            if (Button.RIGHT.isDown()) {
               color++;
               LCD.clear();
               while (Button.RIGHT.isDown()) {
               }
            } // 2<-- -1 | 0 1 2 | 3--> 0
            else if (Button.LEFT.isDown()) {
               color--;
               LCD.clear();
               while (Button.LEFT.isDown()) {
               }
            }
            if (color == 3) {
               color = 0;
            } else if (color == -1) {
               color = 2;
            }
            switch (color) {
            case 0:
               LCD.drawString("Rouge", 0, 0);
               colour = "rouge";
               break;

            case 1:
               LCD.drawString("Jaune", 0, 0);
               colour = "jaune";
               break;

            case 2:
               LCD.drawString("Bleu", 0, 0);
               colour = "bleu";
               break;

            }

         }
         Sound.beepSequenceUp();
         LCD.clear();
         // resumé
         System.out.println("Summery of the command :");
         System.out.println(" > Figure :" + form);
         System.out.println(" > Color  :" + color);
         System.out.println();
         System.out.println("Press \253Print\273 to start.");
         System.out.println("Press any button to cancel.");
         boolean go2 = true;
         while (go2) {
            if (touch1.isPressed()) {
               Sound.beepSequenceUp();
               switch (figure) {
               case 0:
                  Eiffelturm(cavin, Rx, Ry, Rz, colour);
                  break;
               case 1:
                  break;
               case 2:
                  break;
               }
               go2 = false;

               System.out.println("Press ENTER to shut down the printer");
               Thread.sleep(2000);
               if (Button.ENTER.isDown()) {
                  go1 = false;
               }
            }
            else if(Button.LEFT.isDown() || Button.ENTER.isDown() ||Button.RIGHT.isDown() ||Button.ESCAPE.isDown()){
               Sound.buzz();
               go2=false;
            }
         }
      }
   }

   public static int[] setPiece(RemoteNXT cavin, int Rx, int Ry, int Rz,
         int x, int y, int z, int rotation, int piece, String colour)
         throws IOException, InterruptedException {
      int Cx;
      int Cz;
      LCD.drawString("Connected", 0, 0);
      cavin.A.resetTachoCount();
      cavin.B.resetTachoCount();
      cavin.C.resetTachoCount();
      Motor.A.resetTachoCount();
      Motor.B.resetTachoCount();
      Motor.C.resetTachoCount();

      // go carpet
      Motor.C.setSpeed(250);
      Motor.C.backward();

      // define the Variables depending on the color
      if (colour.equals("rouge")) {
         Cx = 3015;
         Cz = 855;
         Sound.beepSequence();
      } else {

         if (colour.equals("bleu")) {
            Cx = 5515;
            Cz = 1935;

         } else { // yellow
            Cx = 4255;
            Cz = 1395;

         }
      }

      // Grey : Positioning
      cavin.C.setSpeed(1000);
      cavin.C.setPower(100);
      new cavinC(-piece + Ry, cavin).start();
      cavin.A.setSpeed(1000);
      // Blue: Ascend (steigt) if the position of the mouth is lower than his
      // target.
      if (Cz < Rz) {
      } else {
         cavin.A.rotate(-Cz + Rz);
      }
      // Red: positioning
      Motor.B.setSpeed(1000);
      Motor.B.rotate(-Cx + Rx);
      // stop but doesn't block (=/= stop) the rolling-carpet
      Motor.C.flt();
      // Blue: Descend if the position of the mouth was higher than his
      // target.
      while (cavin.C.isMoving()) {
      }
      if (Cz < Rz) {
         cavin.A.rotate(Cz - Rz);
      }
      // Take piece
      cavin.A.rotate(485);
      Thread.sleep(500);
      cavin.A.rotate(-585);
      // new defining of the real positions
      Rx = Cx;
      Ry = piece;
      Rz = Cz + 100; // plus de marge
      // ------ Piece taken.
      // ------------------------------------------------------------------------------------------------------------------------------------------------------

      // go carpet
      Motor.C.backward();
      // Ascend if the mouth is lower than the target.
      // Gray
      new cavinC(Ry - y - 15, cavin).start();
      if (z > Rz) {
         // + 195 Because we don t know if there is a piece at this height.
         cavin.A.rotate(-z + Rz - 135 - 60);
      }
      if (rotation == 90) {
         // rotation - 20 to accrue the precision "collision" accrue again
         // the stopper)
         new cavinB(110, cavin);
      }
      // + 30 for the little space, in order to be more accrue at the end.
      Motor.B.rotate(-x + Rx + 30);
      // -135 --> Because we don t know if there is a piece at this height.
      // waiting for the gray if necessary
      while (cavin.C.isMoving()) {
      }
      if (z > Rz) {
         cavin.A.rotate(135);
      }

      if (z < Rz) {
         // ras la piece + 60 de marge
         cavin.A.rotate(-z + Rz - 60);
      }
      // petit à-coup
      cavin.C.setSpeed(50);
      cavin.C.rotate(15);
      cavin.C.setSpeed(1000);
      Motor.B.setSpeed(50);
      Motor.B.rotate(-30);
      // poser piece
      cavin.A.rotate(60 + 300);
      Thread.sleep(500);
      cavin.A.rotate(-300 - 150);
      if (rotation == 90) {
         // rotation +20 to accrue the precision ("collision" accrue again
         // the stopper)
         new cavinB(-110, cavin);
      }
      // new defining of the real positions
      Rx = x;
      Ry = y;
      Rz = z + 135;

      return new int[] { Rx, Ry, Rz };
   }

   public static int[] Eiffelturm(RemoteNXT cavin, int Rx, int Ry, int Rz,
         String colour) throws IOException, InterruptedException {
      Sound.beep();
      // ----------------------(Rx,Ry,Rz,x,y,z,rotation,piece,colour)
      int result[] = setPiece(cavin, Rx, Ry, Rz, 338, 450, 135, 90, 1275,
            colour);
      // result0 result1 result2
      int result1[] = setPiece(cavin, result[0], result[1], result[2], 338,
            450, 270, 90, 1275, colour);
      // result10 result11 result12
      int result2[] = setPiece(cavin, result1[0], result1[1], result1[2],
            338, 450, 405, 90, 1275, colour);
      int result3[] = setPiece(cavin, result[0], result[1], result[2], 338,
            450, 135, 90, 1275, colour);

      return new int[] { result[0], result[1], result[2] };

   }

}


Ps: it s working !
Lego-3D-drucker
New User
 
Posts: 8
Joined: Sun Dec 09, 2012 12:47 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff