nanoFramework.Iot.Device.Sn74hc595 1.2.436

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Sn74hc595 --version 1.2.436
NuGet\Install-Package nanoFramework.Iot.Device.Sn74hc595 -Version 1.2.436
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Sn74hc595" Version="1.2.436" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.Sn74hc595 --version 1.2.436
#r "nuget: nanoFramework.Iot.Device.Sn74hc595, 1.2.436"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install nanoFramework.Iot.Device.Sn74hc595 as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Sn74hc595&version=1.2.436

// Install nanoFramework.Iot.Device.Sn74hc595 as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Sn74hc595&version=1.2.436

SN74HC595 -- 8-bit shift register

SN74HC595 is a 8-bit shift register. Per the datasheet, the SN74HC595 is a "8-Bit Shift Register With 3-State Output Register". The Sn74hc595 binding is based on and is compatible with the more general ShiftRegister binding. The Sn74hc595 binding adds the ability clear the storage register with a single pin. Either binding can be used to control the SN74HC595.

shift-register

The binding abstracts the interaction with the data register, the register clock and other shift register capabilities. The binding enables interaction via GPIO or SPI.

Documentation

Usage

The following example code demonstrates how to use the SN74HC595 with its most basic functions.

Sn74hc595 sr = new(Sn74hc595PinMapping.Minimal);

// Light up three of first four LEDs
sr.ShiftBit(1);
sr.ShiftBit(1);
sr.ShiftBit(0);
sr.ShiftBit(1);
sr.Latch();

// Display for 1s
Thread.Sleep(1000);

// Write to all 8 registers with a byte value
// ShiftByte latches data by default
sr.ShiftByte(0b_1000_1101);

The following diagram demonstrates the required wiring for the Minimal pin mapping. In particular, OE must be wired to ground, and SRCLR must be wired high.

SN74HC595 Minimal pin mapping

The following example demonstrates using additional features and requires different wiring.

Sn74hc595 sr = new(Sn74hc595PinMapping.Complete);

// Write to all 8 registers with a byte value
// ShiftByte latches data by default
sr.ShiftByte(0b_1000_1101);

// Display for 1s
Thread.Sleep(1000);

// disable output temporarily
sr.OutputEnable = false;

// Display for 1s
Thread.Sleep(1000);

// re-enable output
sr.OutputEnable = true;

// clear storage before writing new values
sr.ClearStorage();

// Light up three of first four LEDs
sr.ShiftBit(1);
sr.ShiftBit(1);
sr.ShiftBit(0);
sr.ShiftBit(1);
sr.Latch();

The following diagram demonstrates the required wiring for the Complete pin mapping.

SN74HC595 Minimal pin mapping

If you want to use SPI, see the ShiftRegister binding, which includes more information on SPI.

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.436 476 11/10/2023
1.2.416 323 11/8/2023
1.2.329 583 5/26/2023
1.2.313 519 5/12/2023
1.2.302 585 5/10/2023
1.2.297 563 5/3/2023
1.2.273 607 3/17/2023
1.2.203 706 12/28/2022
1.2.159 782 11/14/2022
1.2.158 801 11/13/2022
1.2.153 756 11/5/2022
1.2.141 809 10/25/2022
1.2.122 869 10/12/2022
1.2.114 790 10/8/2022
1.2.104 822 9/24/2022
1.2.95 850 9/22/2022
1.2.87 877 9/15/2022
1.2.73 829 9/8/2022
1.2.5 855 7/13/2022
1.1.141.41205 869 7/6/2022
1.1.116.8772 872 6/24/2022
1.1.113.2032 773 6/23/2022
1.1.58.10097 841 5/23/2022
1.1.27 813 4/26/2022
1.1.20 821 4/21/2022
1.1.3 870 4/15/2022
1.1.1 827 4/14/2022
1.0.277-preview.128 112 3/26/2022
1.0.277-preview.126 113 3/25/2022
1.0.277-preview.125 110 3/25/2022
1.0.277-preview.113 108 3/20/2022
1.0.277-preview.112 108 3/19/2022
1.0.277-preview.103 112 3/14/2022
1.0.277-preview.102 109 3/11/2022
1.0.277-preview.99 113 3/10/2022
1.0.277-preview.85 111 2/25/2022
1.0.277-preview.60 128 2/4/2022
1.0.277-preview.32 126 1/27/2022
1.0.277-preview.17 124 1/24/2022
1.0.277-preview.1 127 1/11/2022
1.0.259 794 12/9/2021
1.0.218 181 10/18/2021
1.0.155 154 8/31/2021
1.0.148 146 7/22/2021
1.0.105 259 5/29/2021
1.0.70 178 5/26/2021