A place for me to speak-out. A chance for my soul to seek...
' Had I the heavens' embroidered cloths,
Enwrought with golden and silver light,
The blue, the dim and the dark cloths Of night and light and the half light, I would spread the cloths under your feet;
But I, being poor, have only my dreams;
I have spread my dreams under your feet;
Tread softly because you tread on my dreams '
- William Butler Yeats
Last week around at work I had another usual un-usual problem to face with. Having to make lots of mechanisms n components to work with-in seconds or fracs at times I kind-of knew this was always coming.
And invariably so my poor mind couldn't think of anything but Arduino for a handy solution that should be compact, flexible, highly customizable, rugged and most importantly easier to work around.
Now that all I/O's are wired in order as per the schematic, it pretty much works-out itself and it all boils down to the programming now..
I had used the StopWatch library to evoke the timer and initiated the millis() function to record time step value as soon as Arduino is started.
But what I need is just a differential timer with the simple math which gives us the time on air or otherwise.
All that I did is declared some run-time variables and do some math to display the difference value to show only the time between micro-switches getting energised. Otherwise to display the time correctly in the format is similar to Dan Thompson's method as it only records the time values in millis and we have to convert the values to sec, min, hr and microsecs.
The other problem i encounter is the sign reversal as arduino cannot handle large buffer. I finally managed to overcome this error by using the unsigned longint as integer data type.