Table of Contents

Advertisement

2
2
e
Table 5.66: RCTIME Quick Facts.
H
RCT
'
OW
IME
S TIMER WORKS
5: BASIC Stamp Command Reference – RCTIME

RCTIME

(See POT)
1
2
2
RCTIME Pin, State, Variable
p
sx
Function
Measure time while Pin remains in State; usually to measure the
charge/discharge time of resistor/capacitor (RC) circuit.
• Pin is a variable/constant/expression (0 – 15) that specifies the I/O
pin to use. This pin will be placed into input mode.
• State is a variable/constant/expression (0 - 1) that specifies the
desired state to measure. Once Pin is not in State, the command
ends and stores the result in Variable.
• Variable is a variable (usually a word) in which the time
measurement will be stored.
described in Table 5.66.
Quick Facts
Units in Variable
Maximum pulse
width
Explanation
RCTIME can be used to measure the charge or discharge time of a
resistor/capacitor circuit. This allows you to measure resistance or
capacitance; use R or C sensors such as thermistors or capacitive humidity
sensors or respond to user input through a potentiometer. In a broader
sense, RCTIME can also serve as a fast, precise stopwatch for events of
very short duration.
When RCTIME executes, it starts a counter (who's unit of time is shown in
.
Table 5.66). It stops this counter as soon as the specified pin is no longer in
State (0 or 1). If pin is not in State when the instruction executes, RCTIME
will return 1 in Variable, since the instruction requires one timing cycle to
discover this fact. If pin remains in State longer than 65535 timing cycles
RCTIME returns 0.
BS1
BS2
BS2e BS2sx BS2p
BS2
BS2e
2 µs
2 µs
131.07 ms
131.07 ms
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 255
The unit of time for Variable is
BS2sx
0.8 µs
52.428 ms
BS2p
0.9 µs
58.982 ms

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents