adafruit_74hc595

CircuitPython driver for 74HC595 shift register.

  • Author(s): Kattni Rembor, Tony DiCola

Implementation Notes

Hardware:

“* 74HC595 Shift Register - 3 pack

Software and Dependencies:

class adafruit_74hc595.DigitalInOut(pin_number, shift_register_74hc595)

Digital input/output of the 74HC595. The interface is exactly the same as the digitalio.DigitalInOut class, however note that by design this device is OUTPUT ONLY! Attempting to read inputs or set direction as input will raise an exception.

direction

Direction can only be set to OUTPUT.

pull

Pull-up/down not supported, return None for no pull-up/down.

switch_to_input(**kwargs)

switch_to_input is not supported.

switch_to_output(value=False, **kwargs)

DigitalInOut switch_to_output

value

The value of the pin, either True for high or False for low.

class adafruit_74hc595.ShiftRegister74HC595(spi, latch)

Initialise the 74HC595 on specified SPI bus.

get_pin(pin)

Convenience function to create an instance of the DigitalInOut class pointing at the specified pin of this 74HC595 device .

gpio

The raw GPIO output register. Each bit represents the output value of the associated pin (0 = low, 1 = high).