ROBOTC.net forums
http://www.robotc.net/forums/

Does anyone know how to connect the MMX to the NXT?
http://www.robotc.net/forums/viewtopic.php?f=41&t=4335
Page 1 of 1

Author:  Nathan [ Mon Mar 12, 2012 8:47 pm ]
Post subject:  Does anyone know how to connect the MMX to the NXT?

I'm trying to use the Mindsensors's Motor Multiplexer, but I'm not sure how to connect it to the NXT?

So far, I have connected the MMX (port NXT) to the NXT (port S1), connected the green thing on it to a 9 volt battery (can I use this or do I have to use a 6-AA Battery Holder with NXT Mounts?), port M1 to a lego Interactive Servo Motor , and port M2 to a converter cable to a PF extension wire to a LEGO® Power Functions M-Motor.

This is the code I am using, but it doesn't seem to work?

///////////////////////////////////////////////////////////////////////////////////////////////////
// Simple testprogram to show the functionality of the Mindsensors NXTMMX interface in RobotC
// The interface/driver is based on the NXC interface written by Deepak Patil for easy migration
//
// Written by Rudolf Lapie
// 26 APRIL 2010
///////////////////////////////////////////////////////////////////////////////////////////////////

// The driver routines for the Mindsensors Multiplxer
#include "NXTMMX-lib.h"

// MAIN TASK : endless loop displaying the values of the PowerMeter
task main ()
{
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "1 NXT");
nxtDisplayCenteredBigTextLine (4, "5 MOTORS") ;
wait10Msec(400) ;

// Configure port S1 to be a low speed I2C sensor.
SetSensorType(S1, sensorLowSpeed);

// Initialize the NXT MMX
MMX_Init(S1, MMX_ADDRESS, 0) ;

motor[motorA] = MMX_Speed_Full ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "A") ;
wait10Msec(400) ;

motor[motorB] = MMX_Speed_Full ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "AB") ;
wait10Msec(400) ;

motor[motorC] = MMX_Speed_Full ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "ABC") ;
wait10Msec(400) ;

MMX_Run_Unlimited( S1, MMX_ADDRESS, MMX_Motor_1, MMX_Direction_Forward, MMX_Speed_Full) ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "ABC1") ;
wait10Msec(400) ;

MMX_Run_Unlimited( S1, MMX_ADDRESS, MMX_Motor_2, MMX_Direction_Forward, MMX_Speed_Full) ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "ABC12") ;
wait10Msec(400) ;

MMX_Stop( S1, MMX_ADDRESS, MMX_Motor_2, MMX_Next_Action_Brake );
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "ABC1") ;
wait10Msec(400) ;

MMX_Stop( S1, MMX_ADDRESS, MMX_Motor_1, MMX_Next_Action_Brake );
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "ABC") ;
wait10Msec(400) ;

motor[motorC] = 0 ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "AB") ;
wait10Msec(400) ;

motor[motorB] = 0 ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (2, "MOTOR");
nxtDisplayCenteredBigTextLine (4, "A") ;
wait10Msec(400) ;

motor[motorA] = 0 ;
eraseDisplay() ;
nxtDisplayCenteredBigTextLine (1, "NXT>ABC") ;
nxtDisplayCenteredBigTextLine (3, "MMX>12") ;
nxtDisplayCenteredTextLine (5, "by MindSensors") ;

wait10Msec(400) ;

wait10Msec(2000) ;

}

///////////////////////////////////////////////////////////////////////////////////////////////////
// THAT's ALL, FOLKS !
///////////////////////////////////////////////////////////////////////////////////////////////////


Does anyone have a picture on how to do all the connections, if a 9 volt battery will suffice, and what code i should use (I downloaded NXTMMX-lib.h and there are no errors when compiling)?

Author:  mightor [ Tue Mar 13, 2012 2:56 am ]
Post subject:  Re: Does anyone know how to connect the MMX to the NXT?

Is the polarity of the battery connected right? A 9V block battery will not last very long. I would try to find an alternative, if I were you. I use a PF battery pack (6xAA) with a home made adapter cable for it to the MMX.

- Xander

Author:  Nathan [ Sun Mar 18, 2012 12:52 am ]
Post subject:  Re: Does anyone know how to connect the MMX to the NXT?

I have a pf battery pack. How would I make this homemade adapter cable for the mmx?

Author:  mightor [ Sun Mar 18, 2012 3:04 am ]
Post subject:  Re: Does anyone know how to connect the MMX to the NXT?

I took a normal PF extension cable and snipped it in half. You can find out which pin carries what here: http://www.philohome.com/pf/pf.htm in the "Power Functions working" section. I then soldered a black and red one onto the right PF wires:
Image
These are "breadboard wires". They have a stiff, solid wire end to them which makes soldering onto them easy and also stay in the green connector on the MMX very nicely.
I used some simple heat shrink sleeving on the part where there PF wire and these wires meet. You can use electrical tape, too, if you prefer.

Regards,
Xander

Author:  Nathan [ Fri Mar 23, 2012 8:33 pm ]
Post subject:  Re: Does anyone know how to connect the MMX to the NXT?

Is there a way to just test the motors working through the mmx without soddering anything (hopefully using a 9volt batter)?

Author:  mightor [ Sat Mar 24, 2012 1:19 am ]
Post subject:  Re: Does anyone know how to connect the MMX to the NXT?

Well, if you can figure out how to power it with with a 9V battery, sure :)

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/