Driver: Ocbp-007a
import time from pyocbp import OCBP
# Download the .pkg and install it (requires admin password) sudo installer -pkg OCBP007A.pkg -target / After installation, the driver registers a virtual serial device at /dev/ocbp007a0 . You can test with the bundled command‑line tool: ocbp-007a driver
If you’ve just received an OC‑BP‑007A board, follow the installation steps above, run the provided diagnostics, and you’ll be up and running in under ten minutes. Happy coding! import time from pyocbp import OCBP # Download the
# Install prerequisites sudo apt-get install dkms build-essential linux-headers-$(uname -r) channel 1 as input board.set_digital_mode(0
# Main loop try: state = 0 while True: # Toggle output board.write_digital(0, state) # Read input and analog channel 0 inp = board.read_digital(1) analog = board.read_analog(0) print(f"Out=state In=inp V=analog:.3f V") state ^= 1 time.sleep(0.1) except KeyboardInterrupt: print("\nExiting…") finally: board.close() (C‑style API)
# Configure channel 0 as output, channel 1 as input board.set_digital_mode(0, OCBP.MODE_OUTPUT) board.set_digital_mode(1, OCBP.MODE_INPUT)