5: BASIC Stamp Command Reference – RCTIME
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 255
RCTIME
BS1
BS2 BS2e BS2sx BS2p
(See POT)
RCTIME
Pin, State, Variable
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. The unit of time for Variable is
described in Table 5.66.
Quick Facts
BS2
BS2e
BS2sx
BS2p
Units in Variable
2 µs
2 µs
0.8 µs
0.9 µs
Maximum pulse
width
131.07 ms
131.07 ms
52.428 ms
58.982 ms
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.
1
2
e
2
sx
2
p
2
Table 5.66: RCTIME Quick Facts.
H
OW
RCT
IME
'
S TIMER WORKS
.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...