NXTMMX - MMXRegulatedMotor problem

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

Moderators: roger, imaqine, 99jonathan

Nicolas
New User
Posts: 1
Joined: Sat Jan 25, 2014 3:52 pm

NXTMMX - MMXRegulatedMotor problem

Postby Nicolas » Sat Jan 25, 2014 4:10 pm

Hi,
I'm Nicolas and I'm new in the forum. I chose to use NXT and Lejos for my personnal autonomous robot project.
I need 4 motors for my robot : 2 for wheels direction and 2 for head movements. But I have only 1 Mindstorms NXT 2.0 set (limits to 3 motors) !!! So, I've decided to test the motor multiplexer. But it seems to not work properly or I missed something else or I don't understand how it works.
It seems the stop method of the MMXRegulatedMotor prevent the next instruction of rotating (backward or forward). My version is the 0.9.1.

Do you ave any idea ?

Thanks.
Nicolas

This is my test code running on the NXT brick (with the problems) :

Code: Select all

public class TestMMX {

    public static void main(String[] args) throws IOException {
        NXTMMX mux = new NXTMMX(SensorPort.S1);
       
        MMXRegulatedMotor motor = new MMXRegulatedMotor(mux, NXTMMX.MMX_MOTOR_1);
       
        System.out.println("1");
        motor.setSpeed(500);
        System.out.println("2");
       
        motor.forward();
        Delay.msDelay(3000);
        System.out.println("3");
        motor.backward();
        Delay.msDelay(3000);
        System.out.println("4");
        motor.stop(true);
        Delay.msDelay(3000);
        System.out.println("5");
        motor.backward();       // <-- Doesn't work
        Delay.msDelay(3000);
        System.out.println("6");
        motor.forward();
        Delay.msDelay(3000);
        System.out.println("7");
        motor.stop(true);
        Delay.msDelay(3000);
        System.out.println("8");
        motor.forward();        // <-- Doesn't work
        Delay.msDelay(3000);
        System.out.println("9");
        motor.backward();
        Delay.msDelay(3000);
        System.out.println("10");
        motor.stop(true);
        Delay.msDelay(3000);
        System.out.println("11");
        Delay.msDelay(3000);
    }
}

Return to “NXJ Software”

Who is online

Users browsing this forum: Google [Bot] and 1 guest