Skip to content

dimecoin/SimpleShift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Shift Library for the Arduino

About

This is a simple to use library for arduino to control up to 32 shift registers. It is optimized for memory and speed, but also provides a clean and simple API. All states are buffered in memory and pushed to registers at end.

Usage

See example folder for detailed example. See header file (SimpleShift.h) for methods avaiable and documentation.

Basic usage:

// Create object, see below for details on parameters
SimpleShift simpleShift(2, 8, 9, 10);

// clear all bits
simpleShift.clearBuffer();

// Set bit 4 to ON.
simpleShift.setBufferBit(4, HIGH);

// Flush data to take affect.
simpleShift.writeRegisters();

How to Wire

74HC595 Datasheet (pdf)

  • SER [pin 14] on 74HC595 wired to Arduino Digital Pin 8

  • RCLK [pin 12] on 74HC595 wired to Arduino Digital Pin 9

  • SRCLK [pin 11] on 74HC595 wired to Arduino Digital Pin 10

  • VCC [pin 16] should go to 5V

  • GND [pin 8] should go to Ground

  • !OE [pin 13] should be tied to Ground

Pinout

Library needs to know about SER, RCLK and SRCLK pin. They are configurable in software like this:

SimpleShift simpleShift(1, 8, 9, 10);

Parameters are: (NumerOfShiftRegisters, SERPIN, RCKPIN, SCKPIN)

  • Number of Shift Registers wired up (in this case, 1)

You can wire up multiple shift register by tying QH` [pin 9] from first register to SER [pin 14] on second register. All other connections would be same for second register.

TODO

  • Return Number of registers
  • Return byte value of register buffer
  • Functions to set 7 segment display character

About

Simple Shift Library For the Arduino To Make Use of 74HC595 Shift Register[s]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages