Using multiple SLEEP for long delays ?
I recently built a gate opener and programmed a 12F675 to control it via wireless remote. I have a 12v Sealed Lead Acid battery as power,
I've looked at many, many float charger circuits and decided to just program a PIC to close a relay which will allow a trickle charge to top off the battery every, say 100 to 150 hours for a period of about an hour or whatever is needed. (TBD)
I've tried Darrel's "Elapsed timer" but I can't get it to work in this application, "Ticks" seem to be seconds and "Seconds" seem to be minutes, not sure.
Anyway, can I just use multiple SLEEP commands of 65,535 seconds (18+ hours) to achieve the desired delay between charging pauses ?
Or, can anyone suggest a better method ?
Thanks for any advise
Re: Using multiple SLEEP for long delays ?
You can, or put SLEEP in FOR loop.
Re: Using multiple SLEEP for long delays ?
Sure, you can use multiple SLEEP periods and keep track of them, just remember that the SLEEP period isn't very accurate and may (will) change with temperature and even from device to device but in your application I don't think it matters if it differes an hour or two in the end.
There are of course other ways of doing it but, if accuracy isn't an issue, none that is as convenient as SLEEP - not that I can think of anyway.
/Henrik.
Re: Using multiple SLEEP for long delays ?
Great, thanks very much guys ! I'll do a FOR/NEXT routine.