Start Back Next End
  
ZBasic System Library
225
ZBasic Microcontrollers
PinRead
Type
Function returning Byte
Invocation
PinRead(pin)
Parameter
Method
Type
Description
pin
ByVal
integral
A pin number (value must be known at compile time).
Discussion
This function returns an indicator of the logic level present on the specified pin.  A return value of zero
indicates a logic low and a non-zero return value indicates a logic high.  If the value of the pin parameter
is not known at compile time (e.g. a constant) a compile error will result.  Note that the specified pin may
have previously been configured as either an input or an ouput.
The advantage of using this function instead of using GetPin() to achieve the same result is that the call
to this function results in much smaller/faster code and that this function does not reconfigure the pin to
be an input.  The disadvantage is that the pin number must be known at compile time.
Compatibility
This function is only available for native mode devices (ZX or generic target devices) and is not available
in BasicX compatibility mode.
See Also
Previous page Top Next page