INPORT

From Smart Box
Jump to navigation Jump to search

Syntax[edit]

INPORT

Description[edit]

The function INPORT returns the current ‘value’ of all digital sensors as a single number. Each digital sensor has a unique ‘value’ as shown below:

  • SENSOR 0 = 1 when it is on.
  • SENSOR 1 = 2
  • SENSOR 2 = 4
  • SENSOR 3 = 8
  • SENSOR 4 = 16
  • SENSOR 5 = 32
  • SENSOR 6 = 64
  • SENSOR 7 = 128

So if SENSORS 0,3 and 5 are ‘ON’ INPORT will return 41 (1+8+32)

Example[edit]

IF INPORT = 255 THEN PRINT "All sensors are on"

Associated keywords[edit]