Shop OBEX P1 Docs P2 Docs Learn Events
Custom RCTime command — Parallax Forums

Custom RCTime command

cjkogan111cjkogan111 Posts: 20
edited 2007-05-23 22:32 in BASIC Stamp
Hello,
I would like to make my own RCTime routine that allows for a timeout after 1 or 2 seconds. I want to do this to make sure that if something goes wrong with the rc circuit, the stamp doesn't sit for hours waiting for the rc time. I am using a capacitor of somewhere around 10nf. Thinking about it, even if the circuit broke, the cap would probably drain in a reasonable amount of time. Any thoughts?
Thanks!
-cjkogan111

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-23 22:32
    Hello,

    The RCTIME command won’t wait forever…It times out after a maximum measurable time period has elapsed. Please see the following from the Help File. Take care.
    When [b]RCTIME[/b] executes, it starts a counter (who's unit of time is shown above). It stops this counter as soon as the specified pin is no longer in [i]State[/i] (0 or 1). If pin is not in [i]State[/i] when the instruction executes, [b]RCTIME[/b] will return 1 in [i]Variable[/i], since the instruction requires one timing cycle to discover this fact. If pin remains in [i]State[/i] longer than 65535 timing cycles [b]RCTIME[/b] returns 0. 
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.