https://github.com/lathoub/arduino-shiftinout
Arduino ShiftIn ShiftOut
https://github.com/lathoub/arduino-shiftinout
74hc165 74hc595 arduino shift-register shiftin shiftout
Last synced: about 2 months ago
JSON representation
Arduino ShiftIn ShiftOut
- Host: GitHub
- URL: https://github.com/lathoub/arduino-shiftinout
- Owner: lathoub
- License: gpl-2.0
- Created: 2020-11-01T15:16:11.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-02T09:04:26.000Z (over 1 year ago)
- Last Synced: 2025-02-02T10:19:20.475Z (over 1 year ago)
- Topics: 74hc165, 74hc595, arduino, shift-register, shiftin, shiftout
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Arduino-ShiftInOut
The Arduino ShiftInOut is a Serial to Parallel Shifting-Out and Parallel to Serial Shifting-In library.
The hardware bindings for the shifting are provided as C++ template arguments.
Currently supported:
- [74HC165](https://github.com/lathoub/Arduino-ShiftInOut/blob/main/src/hardware/IC74HC165.h)
- [74HC595](https://github.com/lathoub/Arduino-ShiftInOut/blob/main/src/hardware/IC74HC595.h)
The DigitalRead and DigitalWrite functions can be overwritten if faster methods are available (also through C++ temmplate arguments). The [Out-of-the-box implementation](https://github.com/lathoub/Arduino-ShiftInOut/blob/main/src/NativeDigitalIO.h) maps to the default implementation of DigitalRead and Write.
## Usage
### Shift-In
```cpp
#include
#include
#define LATCHPIN A12
#define DATAPIN A14
#define CLOCKPIN A13
#define CHIPCOUNT 4
CREATE_NATIVE_74HC165(si, LATCHPIN, DATAPIN, CLOCKPIN, CHIPCOUNT);
void setup() {
...
}
void loop() {
...
auto result = si.read();
...
```
### Shift-Out
```cpp
#include
#include
#define LATCHPIN A11
#define DATAPIN A15
#define CLOCKPIN A13
#define CHIPCOUNT 4
CREATE_NATIVE_74HC595(so, LATCHPIN, DATAPIN, CLOCKPIN, CHIPCOUNT);
void setup() {
...
}
void loop() {
..
so.setAll(true).commit();
..
}
```