An implementation using PICOs programmable input/output block (PIO) to connect to SN74HC165 8-bit parallel-load shift registers device.
If you are also interested in its output counterpart have a look at PICO-PIO-74HC595
It supports chains of up to 4 devices.
As soon as an imput on a device changes it's state, the state of all inputs it written to the PIOs RX-Fifo. See the included file main.cpp for an example
- Copy sn74165.pio into the directory that holds your applications
- Add: #include "sn74165.pio.h" to your code.
- Add the line: pico_generate_pio_header(test ${CMAKE_CURRENT_LIST_DIR}/sn74165.pio) to the CMakeLists.txt file
- Follow the instructions in Getting started with Raspberry Pi Pico: "Chapter 8. Creating your own Project" to create a directory for your project.
- Copy main.cpp, sn74165.pio and CMakeLists.txt from this repository into the newly created directory.
- Copy the pico_sdk_import.cmake file from the external folder in your pico-sdk installation to your project directory.
- Create the build subfolder, cd into it
- run "cmake .." followed by "make"