Skip to main content
Skip table of contents

BitStateRead: IOType=10

BitStateRead, 2 Command Bytes: 

0

IOType=10

1

Bits 0-4: IONumber

 

 

1 Response Byte: 

0

Bit 0: State

This IOType reads the state of a single bit of digital I/O. The direction setting of the IO will not be changed. When the digital IO is set to output the actual state of the line is read. Only lines configured as digital (not analog) return valid readings.

  • IO Number: 0-7=FIO, 8-15=EIO, or 16-19=CIO.

  • State: 1=High, 0=Low.

Example

PY
# BitStateRead Feedback command
# read the state of a single bit of digital I/O.  Only digital
# lines return valid readings.
# return 0 or 1

import u3
d = u3.U3()
d.debug = True
d.getFeedback(u3.BitStateRead(IONumber = 5))
# Sent:  [0xa, 0xf8, 0x2, 0x0, 0xf, 0x0, 0x0, 0xa, 0x5, 0x0]
# Response:  [0xfb, 0xf8, 0x2, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x1]
# [1]
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.