GithubHelp home page GithubHelp logo

leddisplay's Introduction

LedDisplay: Display driver for multi-digit 7-segment displays

LEDDisplay is a library that renders information onto multi-digit 7-segment displays. This library requires no additional hardware and uses the mutliplex method to refresh each digit. Further, the standalone version can use interrupts to multiplex the digits of the display, meaning that you don't have to constantly call an "update" method to do the multiplexing.

Installation

Take a zip download (clone or download button) from here and install it into your Arduino libraries directory.

Libraries are usually installed into the Arduino directory under libraries. For example on Windows / MacOS it may be: ~/Documents/Arduino/libraries

When you unzip into the libraries directory, enusre the directory is called leddisplay (you'll probably need to remove master from the end).

Simple use case

Include the header and create a global display variable as below:

#include <LedDisplay.h>

// startingPin where the A-G and DP are wired - must be sequential pins.
// commonIsHigh set to true if your common pin is at 5V when on, otherwise false.
// optional noOfDigits sets the number of digits for your display (default 4)

LedDisplay display(startingPin, commonIsHigh, optional noOfDigits );

In setup start the library:

void setup() {
	// This line starts the muliplexing of the digits on an interrupt
	// if you prefer you can update the display manually too (see docs).
	display.startInterrupt();
}

Then you can draw onto the display, here's a few examples:

display.setValueDec(20); // display 20 onto the display
display.setValueFloat(1.234, 3); // display float with 3dp eg (1.234)
display.setValueHex(254); // display the value as Hexadecimal.
display.setValueRaw(1,1); // draw character 1 at position 1.

More information

TheCodersCorner library documenation

leddisplay's People

Contributors

davetcc avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leddisplay's Issues

please help to update library for Common cathode type

Hi ser,
When i active only 3 digit, the display will encounter Wrong display ,i have so need to update like this

void LEDDisplay::setValueDec(unsigned int newValue, boolean zeroPad) {
int start=noOfDigits-1; <<< this line
setNumeric(newValue, 10, 0, start, zeroPad);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.