View unanswered posts | View active topics It is currently Fri Oct 31, 2014 4:10 pm






Reply to topic  [ 4 posts ] 
Sensor Multiplexer 
Author Message
Rookie

Joined: Wed Jan 22, 2014 11:43 pm
Posts: 2
Post Sensor Multiplexer
I'm on and FTC team and I am working on the autonomous coding. I am attempting to use a a HiTechnic sensor multiplexer but I am not quite sure how to code in the sensors. Normally in ROBOTC I would click on "Robot" at the top of the screen and then click "Motors and Sensors Setup" in the bar that would pop down. From there I could select "sensors" in the box that would appear and assign each sensor to a sensor port.
Do I assign sensors in a similar way with the multiplexer? I have been searching for some option within the Motors and Sensors Setup box that allows this to happen.
If it does not work in this way, please help me figure out how to put a sonar sensor in the first ports of the multiplexer, an acceleration sensor in the second, and an IR Seeker 1200 in the third. I already have another sonar sensor in sensor port 2 and a gyro sensor in sensor port 3. The multiplexer would go in port 4.

Thanks for your help.


Thu Jan 23, 2014 12:04 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Sensor Multiplexer
In the Robot->Motors and Sensors Setup dialog, click the Sensors tab. In Sensor Port S4, give it a name (e.g. HTMUX). Pick the sensor type "I2C Custom". Then click OK to update the pragmas. Then in the code right after the pragmas, put in the following lines:
Code:
#define sonarSensor2            msensor_S4_1
#define accelSensor             msensor_S4_2
#define irSeeker                msensor_S4_3

Note that for sensors on the HT Sensor MUX, you need to use Xander's corresponding driver to access those sensors. You can't just use SensorValue[sensor] because Xander's drivers will initialize the sensors behind the MUX properly and it will translate the values to the corresponding sensor type if necessary.


Thu Jan 23, 2014 2:25 am
Profile
Rookie

Joined: Wed Jan 22, 2014 11:43 pm
Posts: 2
Post Re: Sensor Multiplexer
Thank you that was extremely helpful. I was able to do everything, but I was unable to find Xander's drivers anywhere in my files. I'm assuming that they are files that I must #include similar to hitechnic-irseeker-v2.h to use the IR Seeker. Where can I download these files of access them if I already have them?


Thu Jan 23, 2014 9:56 am
Profile
Expert
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 159
Post Re: Sensor Multiplexer
Palmer755 wrote:
Thank you that was extremely helpful. I was able to do everything, but I was unable to find Xander's drivers anywhere in my files. I'm assuming that they are files that I must #include similar to hitechnic-irseeker-v2.h to use the IR Seeker. Where can I download these files of access them if I already have them?


That is correct. The sensor multiplexor driver is in the same place as the IR seeker driver. It is called "hitechnic-sensormux.h".

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://cof7468.weebly.com/.


Thu Jan 23, 2014 11:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.