|
Page 1 of 1
|
[ 13 posts ] |
|
Author |
Message |
piedmont
Rookie
Joined: Fri Dec 02, 2011 6:21 pm Posts: 5
|
 Sensor Multiplexer
Hello,
Does someone have a step-by-step tutorial on how to install the HiTechnic Sensor Multiplexer (NOT the HiTechnic TOUCH Multiplexer)? If you do, could you please post it on the forum? Thank you in advance.
|
Fri Dec 16, 2011 10:56 am |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Sensor Multiplexer
1. Download Xander's driver suite if you haven't already ( http://botbench.com/blog/robotc-driver-suite/) 2. Make sure you installed a 9V battery in the Sensor MUX and turn the power ON. 3. In your code, include Xander's Sensor MUX driver: 4. Connect the Sensor MUX upstream port (not any of the ports labeled 1, 2, 3, 4) to one of the sensor ports of the NXT (S1-S4). 5. Connect whatever sensors you want to use to the Sensor MUX ports 1-4. 6. Add the following lines to your code below the include line in step 3 above. 7. Call Xander's driver to access the sensors.
|
Fri Dec 16, 2011 5:10 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Sensor Multiplexer
Thanks MHTS  I saw this mail this morning but I was on my way out for the day. I couldn't have explained it better myself  - 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 17, 2011 7:04 pm |
|
 |
arendyl
Rookie
Joined: Thu Nov 29, 2012 2:16 pm Posts: 3
|
 Re: Sensor Multiplexer
Hi, I am new to robotc, and I am using the multiplexer to add two force sensors. Could somebody explain to me how to "Call Xander's driver to access the sensors" for the force sensor? Everything else seems to be in working order. thanks
|
Thu Nov 29, 2012 2:20 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Sensor Multiplexer
Please refer to Xander's sample code hitechnic-force-SMUX-test1.c. To play with this sample code, connect the Sensor MUX to NXT Sensor port 1 (S1) and connect the force sensor to port 1 of the Sensor MUX. Compile and run Xander's test program and notice the force reading on the LCD display. If that works, then you can look at the source code of the sample regarding how to call Xander's driver to do the same.
|
Thu Nov 29, 2012 2:38 pm |
|
 |
arendyl
Rookie
Joined: Thu Nov 29, 2012 2:16 pm Posts: 3
|
 Re: Sensor Multiplexer
The force sensor works fine on its own, i just want to know how to reference it with as connected to the Sensor MUX, like you represented with these
|
Thu Nov 29, 2012 3:34 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Sensor Multiplexer
If you look at Xander's sample code, excerpt below: Then you will see the line (extracted below). That's how you read the sensor.
|
Thu Nov 29, 2012 4:41 pm |
|
 |
arendyl
Rookie
Joined: Thu Nov 29, 2012 2:16 pm Posts: 3
|
 Re: Sensor Multiplexer
ah. great, thanks. still learning the ropes
|
Fri Nov 30, 2012 12:34 am |
|
 |
Jasper Davis
Rookie
Joined: Mon Feb 10, 2014 1:01 pm Posts: 1
|
 Re: Sensor Multiplexer
I feel this may need to be updated somewhat. I cannot find the Xander's Driver file, only the RobotC drivers file versions.
|
Mon Feb 10, 2014 1:03 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Sensor Multiplexer
This is current information. You can download the latest driver files from here: https://github.com/botbench/rdpartyrobotcdr. Info on how to do this can be found here: http://botbench.com/blog/2013/12/13/rob ... ow-on-git/= 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 Feb 15, 2014 1:01 am |
|
 |
bringerofawesomeness
Rookie
Joined: Sun Mar 15, 2015 6:28 pm Posts: 1
|
 Re: Sensor Multiplexer
Hello, I have had quite a bit of trouble using IR Seeker Sensor with the HiTechnic Sensor Multiplexer (NOT TOUCH MULTIPLEXER), and I was hoping someone here could help me. I have the Multiplexer plugged into port 4 of the NXT and IR Sensor plugged into port 3 of the Multiplexer. My code is supposed to read the value of the IR Sensor, but all it has been giving me is a value of 0, and I'm sure that both the Multiplexer and the sensor are fully functional. I believe that one of the issues may be the version of the drivers I've installed, so I would appreciate if someone could give me a link to download the latest version. My code is as follows:  |  |  |  | Code: #pragma config(Hubs, S1, HTMotor, HTMotor, HTServo, HTMotor) #pragma config(Hubs, S2, HTMotor, none, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Sensor, S2, , sensorI2CMuxController) #pragma config(Sensor, S3, Gyro, sensorI2CHiTechnicGyro) #pragma config(Sensor, S4, IR, sensorIR) #pragma config(Motor, mtr_S1_C1_1, RightSide, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C2_1, LeftSide, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C2_2, motorG, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C4_1, armangle, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C4_2, armlength, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S2_C1_1, motorJ, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S2_C1_2, motorK, tmotorTetrix, openLoop) #pragma config(Servo, srvo_S1_C3_1, FlapLeft, tServoStandard) #pragma config(Servo, srvo_S1_C3_2, FlapRight, tServoStandard) #pragma config(Servo, srvo_S1_C3_3, DeliveryFlap, tServoStandard) #pragma config(Servo, srvo_S1_C3_4, Clamp, tServoStandard) #pragma config(Servo, srvo_S1_C3_5, IRArm, tServoStandard) #pragma config(Servo, srvo_S1_C3_6, servo6, tServoNone) #pragma config(Servo, srvo_S2_C1_1, LeftGuardian, tServoStandard) #pragma config(Servo, srvo_S2_C1_2, RightGuardian, tServoStandard) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "hitechnic-sensormux.h" #include "hitechnic-irseeker-v2.h"
const tMUXSensor IR = msensor_S4_3;
task main() { eraseDisplay(); wait1Msec(1000);
tHTIRS2 irSeeker; initSensor(&irSeeker, msensor_S4_3);
nxtDisplayCenteredBigTextLine(5, "IR Seeker");
while(true) { displayString(4, "%d", SensorValue[IR]); wait1Msec(2000); } } |  |  |  |  |
Please advise. Best Regards, Sid
|
Sun Mar 15, 2015 6:56 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Sensor Multiplexer
You cannot use SensorValue[] in combination with my driver suite. Take a good look at the examples that I have included with the driver suite, in particular hitechnic-irseeker-v2-SMUX-test1.c, it'll show you exactly what you need to do to get the data from your sensor.
= 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]
|
Wed Mar 18, 2015 1:15 am |
|
 |
Siljapeter
Rookie
Joined: Wed Apr 08, 2015 5:16 am Posts: 1
|
 Re: Sensor Multiplexer
Hi, Use following code: #include "drivers/hitechnic-sensormux.h" #include "drivers/hitechnic-force.h"
// Now we declare the force sensor's port // DON'T do it in the RobotC auto-setup wizard, temping as it may seem. It won't work.
#define FORCE_SENSOR msensor_2_3 // I use #defines for things like this becuase it makes it easier to read code, // and it's easier in the first place. Remember, the good programmer is very lazy.
task main { while(true) { nxtDisplayTextLine(1, "Force:"); nxtDisplayBigTextLine(2, "%i", HTFreadSensor(FORCE_SENSOR)); // HTFreadSensor() reads the raw sensor value // and returns an integer. This is detailed // in the documentation for the "3rd Party // RobotC Library" included w/ the download.
// Do read through it } } Thanks
|
Wed Apr 08, 2015 5:24 am |
|
|
|
Page 1 of 1
|
[ 13 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
|
|