Hey, i am currently making a capacitance measurement circuit, and i need to use the calculation below to find out the time constand (tau) :
I know all the values for Vc and V, all that varies is the t.
The t refers to time, so obviously it inuts into a positive number, i need to change it into a negative and then complete the calculation above.
at the moment i have got this:
i am not able to change the value "eleapsed time" to a negative number, but that isnt such a problem.
i am then outputing Tau into the "Serial.Print" and just getting 0?
Assuming this is the code line
The possible/probable errors are that you mix
** **float** **
. Make sure all the variabes are
float and make all your constants
floattype, too (just to be safe) i.e. write
Tau= ((float)elapsedTime/(log(1.0 - (ThreshH/5.0))));
Can help as it will works with floats/doubles values.
May be, it would be better to check if the values au Tau are correctby displaying it on the monitor...
Give us some news about it.
i am not able to change the value "eleapsed time" to a negative number
elapsedTime/(log(1.0 - (ThreshH/5.0))); ==> (0-elapsedTime)/(log(1.0 - (ThreshH/5.0)));