Skip to main content

IO

Syntax

IO ( expression )

Description

IO is a more complex way to access or control the pins.  When IO (expression) is read, the pin corresponding to expression is converted to an input and the value on that pin is returned.

When assiging a value to IO(expression), then pin expression is converted to an output and the logic value is written to the pin, 0 writes a low level any other value sets the pin high.

Using IO simplifies pins that are being used as both inputs and outputs. 

The ARMmite allows control of 24 pins (0..23), with pins 16..23 shared with the AD pins.

Example

' Set pin 9 as an output and drive it high

IO(9) = 1

IO(9) = NOT IN(9)
' invert pin DO NOT USE IO(9) as that would be ambiguous for controlling the
direction of the pin

' Set pin 8 as an input and reads its value

x = IO(8)

Differences from other BASICs

  • no equivalent in Visual BASIC
  • no equivalent in PBASIC

See also