' This program shows the standard use of the RCTIME instruction measuring an RC
' charge/discharge time.
' with R = 10 k pot and C = 0.1 µf. Use the circuit in the handout.Connect the circuit to pin 7
' Adjust the pot and watch the value shown on the Debug screen change.

'{$STAMP BS2} 'STAMP directive (specifies a BS2)

Result VAR Word 'Word variable to hold result.

Again:
HIGH 7 'Discharge the cap
PAUSE 1 'for 1 ms.
RCTIME 7, 1, Result 'Measure RC charge time.
DEBUG CLS, DEC Result 'Show value on screen.
GOTO Again