Skip to content

A simple Python 3 tool for controlling Shift Registers with RPi GPIO pins

License

Notifications You must be signed in to change notification settings

kevinpthorne/pi_shiftreg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi_shiftreg

A simple Python 3 tool for controlling Shift Registers with RPi GPIO pins.

Installation

Use PIP:

pip install pi_shiftreg

Usage

init_state

    Set up the module to use [set_state]
    :param register_count: how many registers to configure
    :param clock_pin: set the clock pin
    :param data_pin: set the data pin
    :param applicator_pin: set the applicator pin
    :param init_val (optional): set the initial value on each register (default: False)
    :param write_state_out_to (optional): write state to file after application (default: no file)
    :param applicator_delay (optional): cooldown delay between applications (is blocking, default: 0)

Example:

import pi_shiftreg
pi_shiftreg.init_state(24, 17, 18, 27, write_state_out_to="myfile.txt")

set_state

    Set the state of the register given [idx]
    :param idx: index of register
    :param to: new value of register
    :param apply_immediately (optional): optionally defer application

Example:

# call init_state prior
pi_shiftreg.set_state(1, True) # set register 1 to True (1)

About

A simple Python 3 tool for controlling Shift Registers with RPi GPIO pins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages