View unanswered posts | View active topics It is currently Tue Sep 02, 2014 12:24 am






Reply to topic  [ 4 posts ] 
Smux Programming; Declaring multiple tMuxSensors... 
Author Message
Rookie

Joined: Mon Feb 21, 2011 3:40 pm
Posts: 15
Post Smux Programming; Declaring multiple tMuxSensors...
Declaring multiple tMuxSensors gives me errors; here's my code:

Code:
#pragma config(Sensor, S4,     HTSMUX,              sensorI2CCustom)

#include "drivers/hitechnic-sensormux.h"

const static tMUXSensor MuxSensor1 = msensor_S4_1;
const static tMuxSensor MuxSensor2 = msensor_S4_4;

task main() {
 
}


And my error log;

Code:
*Warning*:Unreferenced variable 'MuxSensor1'
**Error**:Variable 'tMuxSensor' declaration must be qualified with type. Type 'short' used.
**Error**:Constant variable 'tMuxSensor' must have initialization expression
**Error**:Expected->';'. Found 'MuxSensor2'
**Error**:Undefined variable 'MuxSensor2'. 'short' assumed.
**Error**:Executable statements not valid in 'main' declaration block


I'm using the latest 3rd party drivers(v3.1), and latest RobotC version(3.54). Thanks in advance.


Sun Nov 18, 2012 4:29 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: Smux Programming; Declaring multiple tMuxSensors...
That should be tMUXSensor not tMuxSensor :)

You have it right on one line and not the other.

= 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]


Sun Nov 18, 2012 4:40 pm
Profile WWW
Rookie

Joined: Mon Feb 21, 2011 3:40 pm
Posts: 15
Post Re: Smux Programming; Declaring multiple tMuxSensors...
Derp. Thanks. :3

Won't make that mistake again...


Sun Nov 18, 2012 5:23 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: Smux Programming; Declaring multiple tMuxSensors...
Don't worry, you will. I know I do, all the time and I should definitely know better. It took me about a minute to spot the bug in your code, it was very hard to see :)

= 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]


Mon Nov 19, 2012 1:46 am
Profile WWW
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.