' PBASIC library,
these routines were written for
and included for general reference
' source in /Program Files/Coridium/BASIClib
FUNCTION RCTIME ( pin, level )
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.
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.
'... some external device has set input pin 7 to low or 0
tim = RCTIME (7, 0)
PRINT "Pin 7 low for "; tim; "
'... function waits for input pin 7 to go to high state
low for 50 us
Differences from other BASICs
- no equivalent in Visual BASIC
- results in microseconds rather than CPU dependent ticks in PBASIC