RCTIME Plus object posted on OBEX
Keezinator
Posts: 21
Hello everyone,
I have just posted an extension to the original RCTIME object written by Beau Schwabe.
http://obex.parallax.com/objects/382/
I made some minor improvement (I think) and resolved some minor bugs while mostly maintaining downwards compatibility.
Have a look at how I use the same function for foreground and background, while keeping the 'wiring' for background operation separated.
I think this is a best practise
The major improvement and the reason to embark on this little project, is a method to calculate the value of the resistor in the RC circuit if you know the value of the capacitor (or visa versa). The application for this is the continuous measurement of a POT meter or a light or temparature sensistive resistor.
It uses FloatMath, so it is NOT blazingly gast and does use some additional memeory. Both are minor issues, because the RCTIME object would use 1 ms per measurement anyway, just to load the capacitor. So the calculations are a very small portion of the elapse time of the object.
An enhancement I can think of is the addition of a method to calculate the voltage applied to the RC circuit (given the values of the resistor and the capacitor).
Feel free to suggest other enhancements.
It is my first (and I hope not the last) contribution to the OBEX, so please tell me what you think.
I have just posted an extension to the original RCTIME object written by Beau Schwabe.
http://obex.parallax.com/objects/382/
I made some minor improvement (I think) and resolved some minor bugs while mostly maintaining downwards compatibility.
Have a look at how I use the same function for foreground and background, while keeping the 'wiring' for background operation separated.
I think this is a best practise
The major improvement and the reason to embark on this little project, is a method to calculate the value of the resistor in the RC circuit if you know the value of the capacitor (or visa versa). The application for this is the continuous measurement of a POT meter or a light or temparature sensistive resistor.
It uses FloatMath, so it is NOT blazingly gast and does use some additional memeory. Both are minor issues, because the RCTIME object would use 1 ms per measurement anyway, just to load the capacitor. So the calculations are a very small portion of the elapse time of the object.
An enhancement I can think of is the addition of a method to calculate the voltage applied to the RC circuit (given the values of the resistor and the capacitor).
Feel free to suggest other enhancements.
It is my first (and I hope not the last) contribution to the OBEX, so please tell me what you think.