View unanswered posts | View active topics It is currently Mon Jul 16, 2018 10:21 am






Reply to topic  [ 6 posts ] 
RobotC 4.29 
Author Message
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 151
Post 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.


Sat Feb 14, 2015 10:38 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: RobotC 4.29
Thanks, I'll take a look at the issue :)

= 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 Feb 15, 2015 1:50 am
Profile WWW
Site Admin
Site Admin
User avatar

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

_________________
| 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]


Mon Feb 16, 2015 10:36 am
Profile WWW
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 151
Post 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);
  }
}


Mon Feb 16, 2015 11:23 pm
Profile
Site Admin
Site Admin
User avatar

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

_________________
| 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 Feb 17, 2015 1:43 am
Profile WWW
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 151
Post 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.


Wed Feb 18, 2015 10:52 pm
Profile
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.