Hello
I did used a ton of the similar function many years ago in Excel, but I just don't get it using C++ I did look at a ton of example, but after three hours, time to ask for help and go to bed.
What is the proper structure to write a switch case code?
How can I switch for a Resitance value greater or minus a define target?
A resistance is calculated using a an output voltage and a known resiatnce.
Now, I want to use different set of parameter depending on the value of the Resistance
long Resistance = (V_Out_0 * R_Pad)/(V_IN - V_Out_0);
switch (Resistance){
case (Resistance >= 60000):
float LogResitance = log(Resistance);
float temp = 1 / (A_MIN + (B_MIN*LogResistance) + (C_MIN * LogResitance * LogResitance * LogResitance);
case (Resistance < 60000) && (Resistance > 25000)
float LogResitance = log(Resistance);
float temp = 1 / (A_MID + (B_MID*LogResistance) + (C_MID * LogResitance * LogResitance * LogResitance);
break;
Celsius = temp - Kelvin;
}
Any help appreciated
Martin