📖⚡Dirs

Set the Input/Output direction status of a port (only affects ports that can change direction).

It is usual practice to use binary notation to set port direction and pin values. A value of "1" represents an output direction, and "0" represents input direction, this is opposite to the PIC micro controller.

Syntax

LET DIRS = Value

Example

LET DIRS = %00010111


 

' DIRS Example
' Dirs.txt
' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
' Select Kic8 for this to compile
' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

DO 

  ' Set to outputs
  ' 1 = output 
  ' 0 = input
  ' Pin3 is fixed as an input
  DIRS = %00010111 

  'Set to inputs
  DIRS = 0

LOOP 

Related commands: