View unanswered posts | View active topics It is currently Thu Dec 18, 2014 8:02 pm






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

Joined: Tue Feb 04, 2014 7:13 pm
Posts: 3
Post 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:


Quote:
**Error**:'*' Indirection levels mismatch. Call to 'sendI2CMsg'. Parameter: 'char * pSendMsg' is 'error_array[0]' of type 'ubyte'.
**Error**:'*' Indirection levels mismatch. Call to 'sendI2CMsg'. Parameter: 'char * pSendMsg' is 'data[0]' of type 'ubyte'.
**Error**:'*' Indirection levels mismatch. Call to 'sendI2CMsg'. Parameter: 'char * pSendMsg' is 'data[0]' of type 'ubyte'.
**Error**:'*' Indirection levels mismatch. Call to 'readI2CReply'. Parameter: 'char * pReplyBytes' is 'data[0]' of type 'ubyte'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'LEGOUS_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'LEGOUS_I2CReply' of type 'tByteArray'.
**Error**:Not enough parameters specified. Call to 'writeI2C'. Parameter: 'short replylen' is 'None specified'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTCS2_I2CReply' of type 'tByteArray'.
**Error**:Not enough parameters specified. Call to 'writeI2C'. Parameter: 'short replylen' is 'None specified'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTSMUX_I2CReply' of type 'tByteArray'.
**Error**:Not enough parameters specified. Call to 'writeI2C'. Parameter: 'short replylen' is 'None specified'.
**Error**:Not enough parameters specified. Call to 'writeI2C'. Parameter: 'short replylen' is 'None specified'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTSMUX_I2CReply' of type 'tByteArray'.
**Error**:Array size mismatch. Call to 'writeI2C'. Parameter: 'short replylen' is 'HTSMUX_I2CReply' of type 'tByteArray'.
**Error**:Not enough parameters specified. Call to 'writeI2C'. Parameter: 'short replylen' is 'None specified'.


Attachments:
SMUX_TEST.c [895 Bytes]
Downloaded 126 times
Tue Feb 04, 2014 7:22 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 213
Post 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
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Tue Feb 04, 2014 7:13 pm
Posts: 3
Post 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
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Tue Feb 04, 2014 7:13 pm
Posts: 3
Post Re: Sensor Multiplexer
The current code has not changed much since the original post, but here is the current file.


Attachments:
SMUX_TEST.c [850 Bytes]
Downloaded 128 times
Thu Feb 06, 2014 5:11 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1359
Post 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
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Tue Oct 21, 2014 1:20 am
Posts: 1
Post Re: Sensor Multiplexer
Thank you for your contributions! Very interesting!

_________________
http://braindumps.com/Security-plus.htm


Tue Oct 21, 2014 1:24 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 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.