Shop OBEX P1 Docs P2 Docs Learn Events
How to make a basic (interruptable) timer? - DOH — Parallax Forums

How to make a basic (interruptable) timer? - DOH

ArchiverArchiver Posts: 46,084
edited 2002-10-29 16:39 in General Discussion
Sometimes I'm pretty dense... Forgot all about just using a program
loop! Getting too enamoured with external chips [noparse]:D[/noparse] Not highly
accurate but I don't need accuracy really - just ballpark.

I used a 10k pot as a voltage divider, fed the wiper to a cap and
used rctime to read it. That lets me set the delay time (divide rct
to come up with a reasonable delay count). Then just looped with a
pause 100 in there until the timer is up OR my continuity test was
satisfied.

Works a treat!

--- In basicstamps@y..., "ghidera2000" <ghidera2000@y...> wrote:
> I have a process where I fill a container with water. I'll be
> putting a simple continuity tester in it to stop the filling when
> its full. I'd also like to put a timer on it as a backup, if for
> some reason the fill detection fails, I'd like it to time out and
> stop filling. The timer doesn't have to be accurate, at most it'll
> have a timeout of one minute - more like 30 seconds for most
tasks.
> I'd also like the time value to be settable.
>
> Any tips or web pages you folks can toss my way? I could use a RTC
> but, that seems like way overkill.
Sign In or Register to comment.