View unanswered posts | View active topics It is currently Thu Aug 21, 2014 7:57 pm






Reply to topic  [ 6 posts ] 
Does anyone know how to connect the MMX to the NXT? 
Author Message
Rookie

Joined: Fri Dec 24, 2010 1:16 am
Posts: 11
Post 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)?


Mon Mar 12, 2012 8:47 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Mar 13, 2012 2:56 am
Profile WWW
Rookie

Joined: Fri Dec 24, 2010 1:16 am
Posts: 11
Post 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?


Sun Mar 18, 2012 12:52 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Mar 18, 2012 3:04 am
Profile WWW
Rookie

Joined: Fri Dec 24, 2010 1:16 am
Posts: 11
Post 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)?


Fri Mar 23, 2012 8:33 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Mar 24, 2012 1:19 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.