NXC SetSensorHTEOPD issue
NXC SetSensorHTEOPD issue
hey,
I get compile error for SetSensorHTEOPD:
SetSensorHTEOPD(2) => error: "," expected
SetSensorHTEOPD(2, bStandard) => error: undefined identifier bStandard
I get compile error for SetSensorHTEOPD:
SetSensorHTEOPD(2) => error: "," expected
SetSensorHTEOPD(2, bStandard) => error: undefined identifier bStandard
Re: NXC SetSensorHTEOPD issue
Did you declare bStandard or is it some kind of unknown variable? Should probably be set to true or false or whatever NXC uses for boolean symbols. It has to do with the short and long range setting for the EOPD.
= Xander
= Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: NXC SetSensorHTEOPD issue
bStandard is a parameter which is named and chosen in the integrated help and it appeared to me if it was sort of a predefined system variable - what it actually isn't.
I already supposed that it was meant for long or short range but there is no information about what this value is likeor of what amount, concerning also the alternative value.
Unfortunately the explanation and the programming example are not correct in either way.
I already supposed that it was meant for long or short range but there is no information about what this value is likeor of what amount, concerning also the alternative value.
Unfortunately the explanation and the programming example are not correct in either way.
Re: NXC SetSensorHTEOPD issue
The b in bStandard indicates a boolean, so it can only be one of two values. s means string, i means int, l means long, d means double, f means float, c is char, etc
= Xander
= Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: NXC SetSensorHTEOPD issue
aah, alright, so bStandard is supposed to be "true" for "short range"...
(maybe the NXC documentation team finds sometimes time to update this help file issue...^^)
(maybe the NXC documentation team finds sometimes time to update this help file issue...^^)
Re: NXC SetSensorHTEOPD issue
A more intuitive name would maybe be bShortRange
= Xander
= Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: NXC SetSensorHTEOPD issue
No, putting an actual value in your name is bad practice; bShortRangeTrue = false ? That just look awful.
= Xander
= Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: NXC SetSensorHTEOPD issue
as it's a constant it might be acceptable.
bShortRangeTrue <=> ShortRange
bLongRangeTrue <=> LongRange
bShortRangeFalse == ! bShortRangeTrue
bLongRangeFalse == ! bLongRangeTrue
bShortRangeTrue == true == bLongRangeFalse
bShortRangeTrue == ! bShortRangeFalse == ! (! bLongRangeFalse) == bLongRangeFalse
anyway, anything is better than an undocumented bStandard
Code: Select all
#define bShortRangeTrue true
#define bShortRangeFalse false
#define bLongRangeTrue false
#define bLongRangeFalse true
bShortRangeTrue <=> ShortRange
bLongRangeTrue <=> LongRange
bShortRangeFalse == ! bShortRangeTrue
bLongRangeFalse == ! bLongRangeTrue
bShortRangeTrue == true == bLongRangeFalse
bShortRangeTrue == ! bShortRangeFalse == ! (! bLongRangeFalse) == bLongRangeFalse
anyway, anything is better than an undocumented bStandard
Re: NXC SetSensorHTEOPD issue
HiTechnic refers to "standard range" and "long range" modes of operation. There is no such thing as a "short range" mode. The only defect here is that the sample program was not updated when the ability to set the mode was added as a required parameter to the API function that configures the sensor.
As with any third party device you should consult the documentation provided by the manufacture for information about how it operates.
John Hansen
As with any third party device you should consult the documentation provided by the manufacture for information about how it operates.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Who is online
Users browsing this forum: No registered users and 0 guests