Table of Contents

ugBASIC User Manual

IN

SYNTAX

   = IN(port)

PURPOSE

The IN command is used to read a value from a specific input/output (I/O) port. The port parameter indicates the exact address of the I/O port from which you want to acquire the data. The port address varies depending on the architecture of the computer and the connected peripheral.

When the program encounters the IN instruction, it stops executing and reads the binary value present on the specified port. The value read from the port is converted into a numeric format understandable by the program and is assigned to the value variable.

The IN command is often used to read data from sensors connected to I/O ports, such as temperature, humidity, light sensors, etc. It can be used to control the status of external devices, such as motors, relays, displays, etc. In combination with other instructions, the IN command can be used to implement serial communication with other devices.

EXAMPLE

  x = IN( &HBC00 )

ABBREVIATION

 In

AVAILABLE ON

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY