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

NXTMMX-v2 with EV3 using 4.27RobotC
http://www.robotc.net/forums/viewtopic.php?f=41&t=10263
Page 1 of 1

Author:  CARBOT [ Thu Jan 15, 2015 12:09 am ]
Post subject:  NXTMMX-v2 with EV3 using 4.27RobotC

I have an EV3 with RobotC 4.27 and need additional motors. Does the Mindsensors NXTMMX-v2 work with this setup?

Author:  mightor [ Thu Jan 15, 2015 1:34 am ]
Post subject:  Re: NXTMMX-v2 with EV3 using 4.27RobotC

For one, you need to use at least 4.28, which you can download here: http://www.robotc.net/blog/2014/12/23/r ... 4-28-beta/

As for the NXTMMX-2, I have not tested the driver suite's driver with that specific sensor on the EV3 yet.

= Xander

Author:  CARBOT [ Tue Jan 20, 2015 10:04 pm ]
Post subject:  Re: NXTMMX-v2 with EV3 using 4.27RobotC

I loaded RobotC 4.28 beta. Loaded the BotBench drivers. Updated the files mindsensors-motormux.h, common.h, and common-mmux.h.
I have the motor mux in Sensor port 2 and the Motor in port 1 of the motor mux.

The code below compiles but the motor does not run when the green LED is on. It does run when the red LED is on. It does this with two different motors. Any ideas what is going on?

Code:
#pragma config(Sensor, S1,     ,               sensorEV3_Color)
#pragma config(Sensor, S2,     MSMMUX,         sensorI2CCustom)
#pragma config(Motor,  motorA,           ,             tmotorEV3_Large, openLoop)
#pragma config(Motor,  motorB,           ,             tmotorEV3_Large, openLoop)
#pragma config(Motor,  motorC,           ,             tmotorEV3_Large, openLoop)
#pragma config(Motor,  motorD,           ,             tmotorEV3_Large, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "mindsensors-motormux.h"

task main()
{
   MSMMUXinit();  //init
        MSMotorStop(mmotor_S2_1);  //stop
        //MSMMUXsetPID(MSMMUX, 0x1B58, 0x0000, 0x927C, 0x3A98, 0x012c, 0x1D4C, 0x10, 0x80);
   MSMMotorEncoderReset(mmotor_S2_1);  //reset mux encoders
   MSMMotorEncoderReset(mmotor_S2_1);  //reset motor 1 encoder
   MSMMotor(mmotor_S2_1, 80);  //move the motor
   setLEDColor(1);  //green
   delay(3000);  //delay 3 sec
   MSMMotor(mmotor_S2_1, -80);  //move the motor
   setLEDColor(2);  //red
   delay(3000);  //delay 3 sec   
   MSMMotor(mmotor_S2_1, 0);  //move the motor
   setLEDColor(3);  //orange
   
   while(1>0)
   {
   delay(10);
   }
}

Author:  CARBOT [ Sat Jan 31, 2015 12:49 pm ]
Post subject:  Re: NXTMMX-v2 with EV3 using 4.27RobotC

I found that a 100ms delay was needed after the MSMotorStop to allow it to work correctly. 50ms still did not allow the 1st MSMMotor command to work.

Code:
      MSMMUXinit();  //init
      MSMotorStop(mmotor_S3_2);  //stop
      delay(100);                     <------------------------------------------------- added this delay!
      MSMMotorEncoderReset(mmotor_S3_2);  //reset motor encoder
      MSMMotor(mmotor_S3_2, 80);  //move the motor
      setLEDColor(1);  //green
      delay(3000);  //delay 3 sec
      MSMMotor(mmotor_S3_2, -80);  //move the motor
      setLEDColor(2);  //red
      delay(3000);  //delay 3 sec
      MSMMotor(mmotor_S3_2, 0);  //move the motor
      setLEDColor(3);  //orange

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