View unanswered posts | View active topics It is currently Fri Jan 19, 2018 7:40 pm






Reply to topic  [ 5 posts ] 
Hitechnic SMUX 
Author Message
Rookie

Joined: Sat Feb 28, 2015 4:55 pm
Posts: 4
Post Hitechnic SMUX
We would like to use the Hitechnic SMUX with a few mindsensors sensors. We now understand that it is only geared to NXT sensors and Hitechnic sensors, but we are using a mindsensors IMU and SumoEyes. Is it possible to integrate the multiplexer with other 3rd party sensors?

-smallkitten


Sat Feb 28, 2015 5:06 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Hitechnic SMUX
Yes, it is possible for quite a few 3rd party sensors. I just never did :)

Basically, it can be done for any I2C sensor that does not require a configuration sequence and has a sane default mode. This is because you cannot write to an I2C sensor via the HT Sensor MUX, you can only configure it to read N bytes at register R at address A. Most normal analogue sensors can be read as well. Keep in mind that EV3 sensors will not work with the SMUX, neither will sensors that rely on the RS485 functionality that the NXT has.

= 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 01, 2015 2:35 am
Profile WWW
Rookie

Joined: Sat Feb 28, 2015 4:55 pm
Posts: 4
Post Re: Hitechnic SMUX
Thanks for the reply! We went over some of your test programs and header files but we are not sure if they need configuring. We are using the the mindsensors IMU, Pressure, and SumoEyes sensors, are they compatible? We are not experienced coders, but this was our first test:

Code:
//Test for Complemantary Filter
#pragma config(Sensor, S2,     HTSMUX,              sensorI2CCustom)

#include "hitechnic-sensormux.h"
#include "mindsensors-imu.h"
const tMUXSensor MSIMU = msensor_S2_1;

task main()
{
   int acc_x_val, acc_y_val, acc_z_val;
   int gyro_x_val, gyro_y_val, gyro_z_val;
   int dt = 0.01;

   while(true) {
      // Read the Gyroscope
    MSIMUreadGyroAxes(MSIMU, acc_x_val, acc_y_val, acc_z_val);

      // Read the Accelerometer
      MSIMUreadAccelAxes(MSIMU, gyro_x_val, gyro_y_val, gyro_z_val);

      //Math
      int angle = 0.98 * (gyro_x_val * dt) + (0.02) * acc_x_val;
      nxtDisplayTextLine(1, "%d", angle);
      wait1Msec(50);
   }
}

These were the errors we got:
Code:
File "IMUComplementaryFilterSMUX.c" compiled on Mar 01 2015 10:55:51
**Error**:Expression does not fit parameter. Call to 'MSIMUreadGyroAxes'. Parameter: 'tSensors link' is 'MSIMU' of type 'tMUXSensor'.
**Error**:Expression does not fit parameter. Call to 'MSIMUreadAccelAxes'. Parameter: 'tSensors link' is 'MSIMU' of type 'tMUXSensor'.


Thanks for your help!
-smallkiten


Sun Mar 01, 2015 11:58 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Hitechnic SMUX
Hey there,

Well, it won't work until someone writes the code to make it work with the SMUX and that hasn't happened yet :)

= 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 01, 2015 12:08 pm
Profile WWW
Rookie

Joined: Sat Feb 28, 2015 4:55 pm
Posts: 4
Post Re: Hitechnic SMUX
Ok thanks! If those sensors don't work for now we will have to revise our plans again. :)
Thanks for all of you help!
-smallkitten


Sun Mar 01, 2015 12:12 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.