Hi I was wondering if you could explain whats happening in this piece of code please. I'v tried to figure it out as best as I can but still have some problems especially with the scaling_reF variable. I can't find what MainMDX.AllAnalogueInputs[accurate_index].CurrentValue; is in the source code.
Code:
case MainMDX.BrainVersion.Version_04:
{
digital_value = (int)(input_byte1 * 256) + (int)input_byte2;
}
break;
}
double scaling_reF = 5.0;
if (accurate_index >= 0 && accurate_index < MainMDX.AllAnalogueInputs.Count)
{
scaling_reF = MainMDX.AllAnalogueInputs[accurate_index].CurrentValue;
if (scaling_reF == 0)
{
scaling_reF = 5.0;
}
}
double reF = ((double)digital_value / 1023.0f) * scaling_reF;
return reF;
}
Thanks
Jeff
Bookmarks