Navigation bar
  Start Previous page
 131 of 283 
Next page End 126 127 128 129 130 131 132 133 134 135 136  

122
InputCapture
Type
Subroutine
Invocation
InputCapture(data, count, flags)
InputCapture(data, count, flags, timeout)
Parameter
Method
Type
Description
data
ByRef
array of
UnsignedInteger
The array in which pulse width information will be stored.
count
ByVal
int16
The number of pulse widths to store.  This should be no
larger than the number of entries in the passed array.
flags
ByVal
Byte
A value of zero requests that a falling edge begin the
capture process while a value of 1 indicates a rising edge. 
All other falues are reserved.
timeout
ByVal
Integral
If non-zero, this parameter specifies a timeout value that, if
exceeded, will terminate the input capture process.
Discussion
InputCaptureEx(pin, data, count, flags, timeout) where pin is the default input capture
pin for the device as shown in the table below.  See the description of InputCaptureEx() for more detailed
information.
Default Input Capture Pin
ZX Models
Pin
ZX-24, ZX-24a, ZX-24p, ZX-24n
12, D.6
ZX-40, ZX-40a, ZX-40p, ZX-40n
20, D.6
ZX-44, ZX-44a, ZX-44p, ZX-44n
15, D.6
ZX-24e, ZX-24ae
14, D.6
ZX-1281, ZX-1281n
29, D.4
ZX-1280, ZX-1280n
47, D.4
ZX-128e, ZX-1281e
8, D.4
Example
Dim pd(1 to 5) as UnsignedInteger
Call PutPin(12, zxInputTriState)
Call InputCapture(pd, UBound(pd), 1)
Compatibility
The BasicX compiler erroneously allows any variable for the first parameter.  This implementation
requires the data type to be UnsignedInteger or Integer although it needn’t be an array.  For
practical purposes, an array will almost always be used.
In BasicX compatibility mode, the use of the optional fourth parameter is not supported.  Also, because
the processor runs at twice the speed of the BX-24 processor, the default time unit is one half of that
provided for by BasicX.
See the description of InputCaptureEx() for a discussion of which ISRs are required.
Previous page Top Next page