Simple test

Ensure your device works with this simple test.

examples/74hc165_simpletest.py
 1# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
 2# SPDX-FileCopyrightText: Copyright (c) 2021 John Woolsey for Woolsey Workshop
 3#
 4# SPDX-License-Identifier: Unlicense
 5
 6
 7import time
 8import board
 9import digitalio
10import wws_74hc165
11
12latch_pin = digitalio.DigitalInOut(board.D5)
13sr = wws_74hc165.ShiftRegister74HC165(board.SPI(), latch_pin)
14
15pin1 = sr.get_pin(1)
16
17while True:
18    print(f"pin 1 = {pin1.value}")
19    time.sleep(1)