Syntax
#include
<PULSE.bas>
' source in /Program Files/Coridium/BASIClib
FUNCTION RCTIME
( pin, level )
Description
Measure the time which pin remains at level, returning the value to variable.
The length of time is
measured in microseconds(us). The minimum time measured is 1 microseconds.
If pin is not at level when the function is called variable is set to 1.
If pin remains at level longer than 1 second variable is set to 0.
Example
#include <PULSE.bas>
INPUT 7
'... some procedure which has set input pin 7 to low or 0 volts
tim =
RCTIME (7, 0)
PRINT "Pin 7 low for "; tim; " us"
'... function waits for input pin 7 to go to high state
Pin 7 low for 50 us
Differences from other BASICs
- no equivalent in Visual BASIC
- results in microseconds rather than CPU dependent
ticks in PBASIC
See also