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

RobotC 4.29
http://www.robotc.net/forums/viewtopic.php?f=41&t=10536
Page 1 of 1

Author:  CARBOT [ Sat Feb 14, 2015 10:38 pm ]
Post subject:  RobotC 4.29

I had RobotC 4.28 working well with the MindSensors sensor and motor multiplexors on an EV3. I tried the latest 4.29 but the sensor code gave me the raspberries with a red flashing light and no message in the debug window. The motor multiplexor was less dramatic but did not work either. Had to uninstall 4.29 and reinstall 4.28. Lost a couple hours and some hair but did get back to a functional state.

Author:  mightor [ Sun Feb 15, 2015 1:50 am ]
Post subject:  Re: RobotC 4.29

Thanks, I'll take a look at the issue :)

= Xander

Author:  mightor [ Mon Feb 16, 2015 10:36 am ]
Post subject:  Re: RobotC 4.29

The Mindsensors SensorMUX will never work on the EV3. The EV3SensorMUX should work.

I have tested the EV3SensorMUX and the MotorMUX and both of them work fine on 4.29 on my EV3 here. Which version of the driver suite are you using?

= Xander

Author:  CARBOT [ Mon Feb 16, 2015 11:23 pm ]
Post subject:  Re: RobotC 4.29

I put 4.29 back in and am using drivers from https://github.com/botbench/robotcdriversuite
RobotC 4.29 (FW10.29)
The motormux is now working.

Using example program mindsensors-ev3smux-test1.c with all 3 sensors set to color sensors.
Program compiles.
After running about 3 seconds I get a beep and red flashing LED, there is a blank screen on the EV3.

Code:
#pragma config(Sensor, S1,     ,               sensorEV3_GenericI2C)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "mindsensors-ev3smux.h"

/**
 * Credits:
 * - Big thanks to Mindsensors for providing me with the hardware necessary to write and test this.
 *
 * License: You may use this code as you wish, provided you give credit where its due.
 *
 * THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 4.10 AND HIGHER

 * \author Xander Soldaat (xander_at_botbench.com)
 * \date 14 December 2014
 */

// The SMUX can have up to 3 sensors attached to it.
tMSEV3 muxedSensor[3];

// Configure your sensor type here.  The following are available:
// colorReflectedLight
// colorAmbientLight
// colorMeasureColor
// gyroAngle
// gyroRate
// infraRedProximity
// infraRedBeacon
// infraRedRemote
// sonarCM
// sonarInches
// sonarPresence
// touchStateBump

tEV3SensorTypeMode typeMode[3] = {colorReflectedLight, colorReflectedLight, colorReflectedLight};

task main()
{
  displayCenteredTextLine(0, "Mindsensors");
  displayCenteredBigTextLine(1, "EV3 SMUX");
  displayCenteredTextLine(3, "Test 1");
  sleep(2000);
  eraseDisplay();
  if (!initSensor(&muxedSensor[0], msensor_S1_1, typeMode[0]))
     writeDebugStreamLine("initSensor() failed! for msensor_S1_1");

  if (!initSensor(&muxedSensor[1], msensor_S1_2, typeMode[1]))
     writeDebugStreamLine("initSensor() failed! for msensor_S1_2");

  if (!initSensor(&muxedSensor[2], msensor_S1_3, typeMode[2]))
     writeDebugStreamLine("initSensor() failed! for msensor_S1_3");

  while (true)
  {
       for (int i = 0; i < 3; i++)
       {
         if (!readSensor(&muxedSensor[i]))
            writeDebugStreamLine("readSensor() failed! for %d", i);

          switch(muxedSensor[i].typeMode)
          {
             case touchStateBump:
               displayTextLine(i*3, "Chan[%d]: Touch", i+1);
               displayTextLine(i*3 + 1, "Touch: %s, Bumps: %d", muxedSensor[i].touch ? "yes" : "no ", muxedSensor[i].bumpCount);
                break;

             case colorReflectedLight:
               displayTextLine(i*3, "Chan[%d]: Ref Light", i+1);
               displayTextLine(i*3 + 1, "Value: %d", muxedSensor[i].light);
                break;

             case colorAmbientLight:
               displayTextLine(i*3, "Chan[%d]: Amb Light", i+1);
               displayTextLine(i*3 + 1, "Value: %d", muxedSensor[i].light);
                break;

             case colorMeasureColor:
               displayTextLine(i*2, "Chan[%d]: Color", i+1);
               displayTextLine(i*2 + 1, "Color: %d", muxedSensor[i].color);
                break;

           case gyroAngle:
               displayTextLine(i*3, "Chan[%d]: Gyro", i+1);
               displayTextLine(i*3 + 1, "Angle: %d", muxedSensor[i].angle);
              break;

           case gyroRate:
               displayTextLine(i*3, "Chan[%d]: Gyro", i+1);
               displayTextLine(i*3 + 1, "Rate: %d", muxedSensor[i].rate);
              break;

           case infraRedProximity:
               displayTextLine(i*3, "Chan[%d]: IR Prox", i+1);
               displayTextLine(i*3 + 1, "Distance: %d", muxedSensor[i].distance);
              break;

           // Only beacon data (proximity and heading) for channel 1 is displayed
           case infraRedBeacon:
               displayTextLine(i*3, "Chan[%d]: IR Beac", i+1);
               displayTextLine(i*3 + 1, "Prox: %d, Head: %d", muxedSensor[i].beaconProx[0], muxedSensor[i].beaconHeading[0]);
              break;

           case infraRedRemote:
               displayTextLine(i*3, "Chan[%d]: IR Rem ", i+1);
               displayTextLine(i*3 + 1, "1: %02d, 2: %02d, 3: %02d, 1: %02d", muxedSensor[i].touch ? "yes" : "no ", muxedSensor[i].bumpCount);
              break;

           case sonarCM:
               displayTextLine(i*3, "Chan[%d]: US CM", i+1);
               displayTextLine(i*3 + 1, "Distance: %d", muxedSensor[i].distance);
               break;

            case sonarInches:
               displayTextLine(i*3, "Chan[%d]: US Inch", i+1);
               displayTextLine(i*3 + 1, "Distance: %d", muxedSensor[i].distance);
              break;

           case sonarPresence:
               displayTextLine(i*3, "Chan[%d]: US Pres", i+1);
               displayTextLine(i*3 + 1, "Present: %s", muxedSensor[i].presence ? "yes" : "no ");
              break;
        }
        displayTextLine(i*3 +2, " ");
       }
     sleep(100);
  }
}

Author:  mightor [ Tue Feb 17, 2015 1:43 am ]
Post subject:  Re: RobotC 4.29

Does powercycling the brick and then running this program help? Don't connect any other sensor to the S1 port, other than the EV3SensorMux.

= Xander

Author:  CARBOT [ Wed Feb 18, 2015 10:52 pm ]
Post subject:  Re: RobotC 4.29

I downloaded the latest common.h and unplugged the sensors and it still did not work.
I swapped the cable and mux without any sensors attached and it worked.
I then put the original mux back and it still worked so I suspect the cable is bad.
Thanks again.

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