LOW 
 
Syntax

LOW ( expression )
Description


  ****  kept for PBASIC compatibility  IO(x) = 0 is preferred *****

LOW will set the pin corresponding to expression to a low value (0V) and then set it to an output.

HIGH and LOW have been added for PBASIC compatibility.

For the ARMmite, PRO, ARMexpress and ARMexpress LITE these pin numbers correspond to the pin numbers shown in the Hardware Section. The numbering was assigned by physical location on the board. So DIR, HIGH, IN, INPUT, IO, LOW, OUT and OUTPUT use these physical pin assignments. But P0(pin) will use the bit assigned by NXP. Going forward new board designs will maintain the bit assignment from NXP for all keywords.

For the ARMweb, DINkit, SuperPRO, PROplus and PROstart these pin numbers correspond only to the Port 0 assigned by NXP, for instance DIR(13) corresponds to P0(13)

With version 8.11 of the firmware, ports beyond port 0, can be accessed as 32-63 for port 1, 64-95 for port 2, and so on. Or you may use the P1 .. P4 commands .

Example

SUB OUTS (x)           ' similar to PBASIC keyword
  DIM i AS INTEGER
 
  FOR i = 0 to 15
    OUT(i) = x and (1 << i)
  NEXT i
END SUB

SUB DIRS (x)           ' similar to PBASIC keyword
  DIM i AS INTEGER
 
  FOR i = 0 to 15
    DIR(i) = x and (1 << i)
  NEXT i
END SUB


main:

DIRS ( &H00FF)      '  set pins 0 to 7 to output
OUTS (255)            '  and then set them high or to 3.3 V

FOR I=0 TO 7
  WAIT (1000)
  LOW (I)                 ' set each pin LOW one after the other every second
NEXT I

Differences from other BASICs

See also