Skip to main content

RCTIME

Syntax

RCTIME pin, level, variable

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

INPUT 7

'... some procedure which has set input pin 7 to low or 0 volts

RCTIME 7, 0, val

PRINT "Pin 7 low for "; val; " 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