Ok, I understand now. Thanks for the explanation. I only have one project in mind that would benefit from you changing it in the enhanced FW, so if you want, you could go ahead (if it isn't too much hassle).afanofosc wrote:What I was trying to say is that the input module code does not bother to populate the ADRaw field in the input module IOMap from the AVR data if you use one of the sensor types that I did not list. So you can't get it period. If it was in the IOMap you could get it via SensorRaw(). I could change this in the enhanced firmware but at the moment it acts just like the standard firmware does.
John Hansen
NXC: faulty SENSOR_TYPE_CUSTOM ?
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
???
@John:
@John: Just say yes or no.
@John:
I need(ed) uncorrupted raw data - is it too much to ask for a programming language? Please tell me what I have to do.
does the following what I need - read unfaked uncorrupted raw values -You can't read raw AVR AD values when you configure the port as any of these types: SENSOR_TYPE_LOWSPEED, SENSOR_TYPE_LOWSPEED_9V, or SENSOR_TYPE_HIGHSPEED.
Code: Select all
SetSensorType(S1, SENSOR_TYPE_TOUCH);
SetSensorMode(S1, SENSOR_MODE_RAW);
Wait(20); // as per John's instructions
int val = SensorRaw(S1);
@John: Just say yes or no.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
I am not John, but if it gives a reading of ~184 when an NXT touch sensor is pressed, then YES IT IS TRUE RAW. I can back that statement up with math.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
thanks Matt, but I want to hear it from John:
doc-helmut wrote:???
@John:I need(ed) uncorrupted raw data - is it too much to ask for a programming language? Please tell me what I have to do.does the following what I need - read unfaked uncorrupted raw values -You can't read raw AVR AD values when you configure the port as any of these types: SENSOR_TYPE_LOWSPEED, SENSOR_TYPE_LOWSPEED_9V, or SENSOR_TYPE_HIGHSPEED.:?:Code: Select all
SetSensorType(S1, SENSOR_TYPE_TOUCH); SetSensorMode(S1, SENSOR_MODE_RAW); Wait(20); // as per John's instructions int val = SensorRaw(S1);
@John: Just say yes or no.
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
Does this mean the rest of us are idiots?doc-helmut wrote:thanks Matt, but I want to hear it from John
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
Nah, the rest of us understood what John said without having to have it repeated three timesDoes this mean the rest of us are idiots?
- 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: faulty SENSOR_TYPE_CUSTOM ?
doc-helmut wrote:???
@John:I need(ed) uncorrupted raw data - is it too much to ask for a programming language? Please tell me what I have to do.does the following what I need - read unfaked uncorrupted raw values -You can't read raw AVR AD values when you configure the port as any of these types: SENSOR_TYPE_LOWSPEED, SENSOR_TYPE_LOWSPEED_9V, or SENSOR_TYPE_HIGHSPEED.Code: Select all
SetSensorType(S1, SENSOR_TYPE_TOUCH); SetSensorMode(S1, SENSOR_MODE_RAW); Wait(20); // as per John's instructions int val = SensorRaw(S1);
@John: Just say yes or no.
no you're not idiots, you're English or American or English-speaking Dutch...
I'm not speaking English (ok, enough English to order a burger and a Coke at McDonald's) , I have to use GoogleTranslate or Babelfish and some posts contain so many words and so many things that I don't need to know for the moment and so many fw stuff or NBC code that I don't understand at all that the translations to German gives me only trash.
And e.g. I read things which I never had asked before, e.g.I have no idea why John started talking about i2c drivers - I never asked a single question about i2c in my TO question.
A simple definite answer containing just "yes" or "no" or only the code that I need to know was all I had ever requested.
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
yes? If the value you get from the AVR in what it calls the ADValue (see below) can be called an unfaked uncorrupted raw value then if I understand the firmware source code I think that the answer might be yes.
If you can write pseudo recursive chess playing programs translated from obfuscated C code then you can understand the firmware source code at least as well as I can.
These snippets seem to prove that if you set the sensor as a SWITCH or SENSOR_TYPE_TOUCH (same value as SWITCH) then the ADRaw field of the Input module IOMap is set to the value that is read from the AVR chip and only "corrupted" by ANDing it with 0x03FF. The mode does not matter. The type can be any of the other types I previously mentioned but NOT the types that I mentioned that you can't use. Just read the unfaked uncorrupted RAW value using SensorRaw rather than SENSOR_n or Sensor or SensorValue.
John Hansen
If you can write pseudo recursive chess playing programs translated from obfuscated C code then you can understand the firmware source code at least as well as I can.
Code: Select all
#define INPUTGetVal(pValues, No) *pValues = (UWORD)IoFromAvr.AdValue[No]; \
*pValues &= 0x03FF
void dInputGetRawAd(UWORD *pValues, UBYTE No)
{
INPUTGetVal(pValues, No);
}
case SWITCH:
{
UWORD InputVal;
dInputGetRawAd(&InputVal, No);
IOMapInput.Inputs[No].ADRaw = InputVal;
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: NXC: faulty SENSOR_TYPE_CUSTOM ?
sorry, John, I really honestly understand no single word of the NBC or C++ or firmware code or what this language ever is or does.
But the answer that it is the one and only real raw value I get is all I wanted to know, thanks!
(but I never succeeded recursive chess programs because NXC unfortunately don't has recursions ;) )
But the answer that it is the one and only real raw value I get is all I wanted to know, thanks!
(but I never succeeded recursive chess programs because NXC unfortunately don't has recursions ;) )
Who is online
Users browsing this forum: Semrush [Bot] and 0 guests