Author |
Message |
TheTerrorBelow
Rookie
Joined: Tue Feb 04, 2014 7:13 pm Posts: 3
|
 Sensor Multiplexer
I was trying to create a testbed for the Sensor Multiplexer so that I could test how it would work for our robot. I chose 4 different sensors and tried to configure them. My program does not read any errors, however the errors the debugger window comes up with are all in the included drivers from Xander's suite. I have the newest update of the Suite, and have not had these errors before. I have included my code and here are the errors it is registering:
|
Tue Feb 04, 2014 7:22 pm |
|
 |
BurningLights
Professor
Joined: Sat Aug 31, 2013 9:15 am Posts: 256
|
 Re: Sensor Multiplexer
What version of ROBOTC are you using? It could be that the latest drivers are not compatible with older ROBOTC versions.
_________________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://bluechariotsoffire.com/.
|
Tue Feb 04, 2014 10:40 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Sensor Multiplexer
That looks like an error you'd get if you use the drivers with an old version of ROBOTC.
= 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 Feb 05, 2014 1:59 am |
|
 |
TheTerrorBelow
Rookie
Joined: Tue Feb 04, 2014 7:13 pm Posts: 3
|
 Re: Sensor Multiplexer
I reloaded Xander's driver suite, and I am running ROBOTC 3.62. That fixed the errors, but now I am having trouble getting the sensors to read any values. Sensors 1 and 3 read values of 0, and 2 and 4 read values of 1023
|
Thu Feb 06, 2014 1:16 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Sensor Multiplexer
Without seeing your code, it's completely impossible to see what could be the cause.
= 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]
|
Thu Feb 06, 2014 3:14 pm |
|
 |
TheTerrorBelow
Rookie
Joined: Tue Feb 04, 2014 7:13 pm Posts: 3
|
 Re: Sensor Multiplexer
The current code has not changed much since the original post, but here is the current file.
|
Thu Feb 06, 2014 5:11 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Sensor Multiplexer
There are multiple problems in your code. First, you need to read Xander's example code on how to read each sensor. Since you are using his driver suite, you can't just read SensorValue for sensors behind the Sensor MUX, you need to call the functions in Xander's drivers. Secondly, you have improper use of the nxtDisplayTextLine function. The corrected code looks something like below:  |  |  |  | Code: #pragma config(Sensor, S1, HTSMUX, sensorI2CCustom) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "drivers\hitechnic-sensormux.h" #include "drivers\lego-ultrasound.h" #include "drivers\lego-sound.h" #include "drivers\lego-touch.h" #include "drivers\hitechnic-colour-v2.h"
#define LGSONAR msensor_S1_1 #define LGSOUND msensor_S1_2 #define HTCOLOR msensor_S1_3 #define LGTOUCH msensor_S1_4
task main() { while (true) { nxtDisplayTextLine(1, "Sonar=%d", USreadDist(LGSONAR)); nxtDisplayTextLine(2, "Sound=%d", SNDreadNorm(LGSOUND)); nxtDisplayTextLine(3, "Color=%d", HTCS2readColor(HTCOLOR)); nxtDisplayTextLine(4, "Touch=%d", TSreadState(LGTOUCH)); wait1Msec(100); } } |  |  |  |  |
|
Thu Feb 06, 2014 8:35 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Sensor Multiplexer
Thanks MHTS  = 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 Feb 07, 2014 6:37 am |
|
 |
raima55
Rookie
Joined: Tue Oct 21, 2014 1:20 am Posts: 1
|
 Re: Sensor Multiplexer
Thank you for your contributions! Very interesting!
|
Tue Oct 21, 2014 1:24 am |
|
|