Author |
Message |
skatefriday
Novice
Joined: Tue Dec 11, 2012 9:19 pm Posts: 58
|
 RobotC Driver suite HTSMUX support
Why aren't some of the configuration functions for both the compass and the ir seeker supported through the mux? For example...  |  |  |  | Code: ifdef __HTSMUX_SUPPORT__ // ---------------------------- DC Signal processing ----------------------------- int HTIRS2readDCDir(tMUXSensor muxsensor); bool HTIRS2readAllDCStrength(tMUXSensor muxsensor, int &dcS1, int &dcS2, int &dcS3, int &dcS4, int &dcS5); int HTIRS2readDCAverage(tMUXSensor muxsensor); // ---------------------------- AC Signal processing ----------------------------- int HTIRS2readACDir(tMUXSensor muxsensor); bool HTIRS2readAllACStrength(tMUXSensor muxsensor, int &acS1, int &acS2, int &acS3, int &acS4, int &acS5);
bool HTIRS2readEnhanced(tMUXSensor muxsensor, int &dir, int &strength);
tConfigParams HTIRS2_config = {HTSMUX_CHAN_I2C, 13, 0x10, 0x42}; /*!< Array to hold SMUX config data for sensor */ #endif // __HTSMUX_SUPPORT__
|  |  |  |  |
Note that is not in that list and there's no implementation for it for the mux elsewhere in the file. Similar omissions exist for compass calibration functions.
|
Thu Dec 13, 2012 7:59 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: RobotC Driver suite HTSMUX support
Because the mux only allows reading from the sensors hooked to it but not writing to them. So unless the default mode of the sensor is what you want, good luck with changing sensor mode to non-default. I supposed that's why they call it "Sensor MUX" and not generic I2C MUX.
|
Fri Dec 14, 2012 2:39 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: RobotC Driver suite HTSMUX support
^-- What MHTS said.
It is a hardware limitation, no amount of programming or tweaking on my side will change that. If it's not in my driver suite, you can be pretty sure the sensor does not support it; I tend to expose all of the available functionality.
= 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]
|
Fri Dec 14, 2012 5:49 am |
|
 |
skatefriday
Novice
Joined: Tue Dec 11, 2012 9:19 pm Posts: 58
|
 Re: RobotC Driver suite HTSMUX support
Thanks for the response. That explains it. We calibrated the compass by bypassing the mux. For the IR seeker does anyone know if it defaults to the 1200hz DSP mode? Odd though that the mux does not allow writes given that you can get one of these http://www.nxp.com/documents/data_sheet/PCA9548A.pdffor about a dollar in quantity and you'll get full bi-directional data flow. Then it's just a matter of getting the NXT brick to understand how to select the correct port. Given that it's possible to do generic i2c writes out a given link it would seem that given a through hole package (i can't do surface mount soldering), and appropriate connectors for the brick cables it wouldn't be too difficult to build a pca9548 based mux to work with lego sensors. And for FTC it would be nice to have one with a voltage regulator, 7805, to step down the voltage from the battery so it doesn't need a separate battery pack. But thanks Xander, I always refer to you as the nice man from Europe who wrote all that nice software my kids are using. They laugh at me.
|
Sat Dec 15, 2012 12:54 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: RobotC Driver suite HTSMUX support
Yes, which also happens to be the standard frequency used by the IR beacons. Maybe some company will come up with something like that. That wouldn't work with the analogue sensors, though. I have a prototype HT SMUX (one of the first ones) with a nice Power Functions lead out of it, so I just hook it up to one of those battery packs. Hah, I would probably laugh at that, too  Thanks for the compliment! = 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]
|
Sat Dec 15, 2012 1:39 am |
|
 |
skatefriday
Novice
Joined: Tue Dec 11, 2012 9:19 pm Posts: 58
|
 Re: RobotC Driver suite HTSMUX support
Also oddly enough we could not get the touch sensor to work through the mux. We have the compass and IR sensor working, but add in the touch sensor and it was a constant read of 1. The sensor works fine directly connected to the nxt. And yes, we were using your library functions and appropriate declarations for reading the touch sensor through the mux vs the RobotC primitives and basic pragma setup for reading it directly. Please send me one. 
|
Sat Dec 15, 2012 1:47 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: RobotC Driver suite HTSMUX support
Hrmm, are you using Driver Suite 3.2 and the 3.55 beta 2 ROBOTC? I know there were casting issues in previous versions but I thought they were fixed in beta 2.
= 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]
|
Sat Dec 15, 2012 1:53 am |
|
 |
skatefriday
Novice
Joined: Tue Dec 11, 2012 9:19 pm Posts: 58
|
 Re: RobotC Driver suite HTSMUX support
We are using RobotC 3.54 and whatever came before Driver Suite 3.2. I fixed your signed/unsigned warnings in the ir-seeker file, and was going to send you a diff when I noticed that you had released a new version and looked at saw that you fixed them as well.
|
Sat Dec 15, 2012 2:11 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: RobotC Driver suite HTSMUX support
You should always use the latest of my driver suite, I only have enough time to support one version.
= 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]
|
Sat Dec 15, 2012 2:42 am |
|
 |
roboRed
Expert
Joined: Fri Nov 02, 2012 12:07 am Posts: 163 Location: California, USA
|
 Re: RobotC Driver suite HTSMUX support
_________________ string Robored = "Awesome" ~~Neil Balch~~
|
Sat Dec 15, 2012 11:37 pm |
|
 |
Mentor3923
Rookie
Joined: Sat Sep 03, 2011 10:03 am Posts: 32
|
 Re: RobotC Driver suite HTSMUX support
[quote= "skatefriday"] Also oddly enough we could not get the touch sensor to work through the mux. We have the compass and IR sensor working, but add in the touch sensor and it was a constant read of 1. The sensor works fine directly connected to the nxt. And yes, we were using your library functions and appropriate declarations for reading the touch sensor through the mux vs the RobotC primitives and basic pragma setup for reading it directly.[/quote] I had the same problem with the SMUX and the touch sensor always returning a 1. I finally downloaded 3.55 Beta 2 with drivers 3.2.1 and i now seems to work properly. 
|
Tue Dec 18, 2012 3:04 pm |
|
 |
fee.carl@yahoo.com
Rookie
Joined: Mon Jan 07, 2013 11:44 pm Posts: 3
|
 Re: RobotC Driver suite HTSMUX support
Does anyone have any easy to use sample code for using the IR V2 on the MUX and returning the values 0 - 9?
|
Tue Jan 08, 2013 12:26 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: RobotC Driver suite HTSMUX support
Did you look at the hitechnic-irseeker-v2* programs? There should be a few SMUX examples in there.
= 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 Jan 08, 2013 3:07 am |
|
 |
fee.carl@yahoo.com
Rookie
Joined: Mon Jan 07, 2013 11:44 pm Posts: 3
|
 Re: RobotC Driver suite HTSMUX support
Yes I did but the programs I tried all returned raw values from the five independent channels. If you say there is sample code for returning values 0-9 Ill look harder.
|
Tue Jan 08, 2013 1:44 pm |
|
 |
fee.carl@yahoo.com
Rookie
Joined: Mon Jan 07, 2013 11:44 pm Posts: 3
|
 Re: RobotC Driver suite HTSMUX support
Found it. Thank you.
|
Wed Jan 09, 2013 12:03 am |
|
|