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.
= IN(port)
x = IN( &HBC00 )
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
IN ↔ In
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS