trouble in using sensormux by robotc
 Software and Programming Related   Started by Leonangiee S   2015-09-11 14:21:29 -04:00   Comments: 2    Viewed: 519

  1. Leonangiee S
    Leonangiee S Member

    Postby leoangie » Mon Apr 13, 2015 6:48 pm

    I am from china, and I buy a sensormux from your company weeks ago.
    I am going to join a robotic game called ROBOCUP JUNIOR.I found the sensormux can help me a lot。
    BUt, yesterday ,when I try program it , i found many trouble.
    because the mindsensors-sensormux just give me two fuction :
    mssmuxsetchan() and a voltage fuction

    the mssmuxsetchan() can set channel 1-4,
    but I found I can set 2-4sensors at one time.
    the emaple code that:
    // We have a Mindsensors accelerometer attached to channel 1
    MSSMUXsetChan(MSSMUX, 1);
    SensorType[MSSMUX] = sensorI2CCustom;
    MSACreadAccel(MSSMUX, x, y, z);

    // We have a Angle Sensor attached to channel 2
    MSSMUXsetChan(MSSMUX, 2);
    SensorType[MSSMUX] = sensorI2CCustom;
    angle = MSANGreadAngle(MSSMUX);

    displayTextLine(3, "Batt: %d mV", voltage);
    displayTextLine(4, "Angle: %d deg", angle);
    displayTextLine(5, "Tilt: ");
    displayTextLine(6, "%d, %d, %d", x, y, z);
    }

    CAN'T GET SENSORVALUE FORM EACH CHANNEL , I TRY MANY WAYS ,BUT FAILED.
    COULD YOU HELP ME AND SEND ME SOME CODE TO HELP ME READ THE SENSORVALUE FORM EACH CHANNEL!!THX!!
    :D :D
    Leonangiee S, 2015-09-11 14:21:56 -04:00
  2. Mindsensors Support
    Mindsensors Support Member Richmond

    Postby micgil2293 » Tue Apr 14, 2015 11:16 am

    All you have to do is set the channel for the SensorMux. You can then talk directly to the sensors using the functions in the corresponding device driver. Contact the robotC forum for support using the third party driver suite.

    FYI: The SensorMux was designed to connect multiple NXT sensors and sensors that use lots of power. Although it is possible to use low power I2C devices with the SensorMux, you will see better performance from the ABSIMU and the AngleSensor if you connect them directly to the NXT brick or use the Split-Nx.

    With the Split-Nx, just make sure your sensors have different I2C addresses and you can talk to each directly without complicating your code with SensorMux functions. Also, the Split-Nx will provide much faster communication.
    Mindsensors Support, 2015-09-11 14:22:27 -04:00
  3. (You must log in or sign up to post here)

Log in | Sign up
Tems & Conditions!
Help!