ROBOTC.net forums
http://robotc.net/forums/

Smux Programming; Declaring multiple tMuxSensors...
http://robotc.net/forums/viewtopic.php?f=41&t=5129
Page 1 of 1

Author:  Michael120 [ Sun Nov 18, 2012 4:29 pm ]
Post subject:  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.

Author:  mightor [ Sun Nov 18, 2012 4:40 pm ]
Post subject:  Re: Smux Programming; Declaring multiple tMuxSensors...

That should be tMUXSensor not tMuxSensor :)

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

= Xander

Author:  Michael120 [ Sun Nov 18, 2012 5:23 pm ]
Post subject:  Re: Smux Programming; Declaring multiple tMuxSensors...

Derp. Thanks. :3

Won't make that mistake again...

Author:  mightor [ Mon Nov 19, 2012 1:46 am ]
Post subject:  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

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/