Skip to content

Arduino library to control 7-segment displays using SPI and 74hc595/74hc4094 shift registers

License

Notifications You must be signed in to change notification settings

029ah/z7seg_led

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

z7seg_led library for Arduino

This is a library to control 7-segment displays using SPI and 74hc595/74hc4094 shift registers. It also has customizable output pattern (default is Q0=A, Q1=B, .. , Q6=G, Q7=.)

Hardware

The following are needed

  • Any arduino board
  • Shift register, 74hc595 and 74hc4094 are currently supported
  • 7-segment led display
  • Transistor array or pack of transistors
  • Current-limiting resistors

Example

This is a wiring diagram for connecting one or more display via 74hc4094 IC:

alt text

Connection:

Arduino 74HC4094
MOSI (11) D ( 2)
SCK (13) CLK ( 3)
OE ( 9, PWM) OE (15)
CE ( 8) STR ( 1)
VCC MR (10)

#include <z7seg_led.h>
#include <SPI.h>

const int CE = 8;
const int OE = 9;

z7seg_led display(OE, CE);

void setup() {
    SPI.begin();
    display.begin();
    display.set_type(z7seg_led_74hc4094);
    display.set_pattern("AFEDCBG."); // Mirrored pattern
}

void loop()
{
    static int i = 0;

    display.begin_transfer();
    display.send_digit(i++);
    display.end_transfer();

    if (i >= 10) {
        i = 0;
    }

    delay(250);
}

Contributors

Written by Pershin Sergey

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version.

About

Arduino library to control 7-segment displays using SPI and 74hc595/74hc4094 shift registers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages