145 of 318
ZBasic System Library 135 ZX Microcontroller Family 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 values are reserved. timeout ByVal Integral If non-zero, this parameter specifies a timeout value that, if exceeded, will terminate the input capture process. Discussion Invoking this routine is equivalent to the call InputCaptureEx(pin, data, count, flags) or 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, ZX-24r, ZX-24s 12, D.6 ZX-40, ZX-40a, ZX-40p, ZX-40n, ZX-40r, ZX-40s 20, D.6 ZX-44, ZX-44a, ZX-44p, ZX-44n, ZX-44r, ZX-44s 15, D.6 ZX-24e, ZX-24ae, ZX-24ne, ZX-24pe, ZX-24nu, ZX-24pu 14, D.6 ZX-328n, ZX-328l 14, B.0 ZX-32n, ZX-32l 12, B.0 ZX-1281, ZX-1281n 29, D.4 ZX-24x 12, C.0 ZX-32a4 10, C.0 ZX-128a1 15, C.0 ZX-128e, ZX-128ne, ZX-1281e, ZX-1281ne 8, D.4 ZX-328nu 11, B.0 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.