Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naguissa/usevensegmentlib
Arduino, ESP8266 and STM32 7-segment multiplexed displays library - uSevenSegmentLib
https://github.com/naguissa/usevensegmentlib
7-segment 7-segment-display arduino arduino-library multiplexed multiplexed-displays multiplexed-outputs naguissa seven-segment seven-segments-display
Last synced: 2 months ago
JSON representation
Arduino, ESP8266 and STM32 7-segment multiplexed displays library - uSevenSegmentLib
- Host: GitHub
- URL: https://github.com/naguissa/usevensegmentlib
- Owner: Naguissa
- License: lgpl-3.0
- Created: 2018-02-20T08:58:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-18T16:23:58.000Z (almost 1 year ago)
- Last Synced: 2024-05-01T14:27:07.823Z (9 months ago)
- Topics: 7-segment, 7-segment-display, arduino, arduino-library, multiplexed, multiplexed-displays, multiplexed-outputs, naguissa, seven-segment, seven-segments-display
- Language: C++
- Homepage: https://www.foroelectro.net/electronica-digital-microcontroladores-f8/usevensegmentlib-libreria-arduino-para-controlar-d-t193.html
- Size: 148 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Arduino, ESP8266 and STM32 7-segment multiplexed displays library - uSevenSegmentLib #
Master status: [![Build Status](https://travis-ci.org/Naguissa/uSevenSegmentLib.svg?branch=master)](https://travis-ci.org/Naguissa/uSevenSegmentLib)
## What is this repository for? ##
Really tiny library to control multiplexed basic 7 segments displays.
It can work with only a display but it's intended to use more than one and drive them multiplexed.
If you want to use only one display you can do it without flickering, without using timers and using less code driving it directly.
## Important: Dependencies ##
This library requires uTimerLib libary; it's available on IDE Library Manager and also here:
https://github.com/Naguissa/uTimerLib
https://github.com/Naguissa/uTimerLib/releases## How do I get set up? ##
You can get it from Arduino libraries directly, searching by uSevenSegmentLib.
For manual installation:
* Get the ZIP from releases link: https://github.com/Naguissa/uSevenSegmentLib/releases
* Rename to uSevenSegmentLib.zip
* Install library on Arduino## Documentation and extras ##
You can find all documentation and extras in this repository: https://github.com/Naguissa/uSevenSegmentLib_doc_and_extras
You can read documentation online here: https://naguissa.github.io/uSevenSegmentLib_doc_and_extras/
## Usage ##
Important: Remember to add resistors as needed, depending on your MCU voltage.
### Constructor: ###
uSevenSegmentLib::uSevenSegmentLib(unsigned char displays, int pins[8], int *muxes, unsigned int freq, bool common_anode);
Parameters:
- displays: number of displays (7-segment modules)
- pins: Array of all pins of the displays in {a, b, c, d, e, f, g, h} form. See extras folder for details.
- muxes: Array of common anode/cathode, one by each display. Used to multiplex the displays.
- freq: Optional. Desired refresh frequency. Default is 40 (Hz). This frequency will be multiplied by number of displays, so it's a "all displays" refresh rate.
- common_anode: Optional. Set to true if you are using common_anode displays.### Set a value: ###
void uSevenSegmentLib::set(long int number);
Parameters:
- number: Number to display. It also accept negative numbers.### Start displaying: ###
void uSevenSegmentLib::attachInterrupt();
Attaches internal timer interrupts to run multiplexed displays.
### Extra: Leading zero fill ###
void uSevenSegmentLib::zeroFill(bool zf);
Parameters:
- zf: If true, leading zeros will be displayed instead turning off that displays.## Typical usage: ##
- You instantiate an object (usually a global scope object): uSevenSegmentLib sevenSegments(3, pins, muxes);
- Then set any initial value on it on setup(): sevenSegments.set(0);
- And attach interrupts to start working (still on setup()): sevenSegments.attachInterrupt();
- Then, wherever you want, you can change displayed values at your will: sevenSegments.set(77);## Examples ##
Included on example folder, available on Arduino IDE.
- Three 7-segments counter example, that counts from 0 to 255.
- One example to test connections to a 7-segment module; lights sequently from "a" to "h" segments. This example doesn't use library functions.## Extra ##
Look in extras folder for a typical pinout and
## Who do I talk to? ##
* [Naguissa](https://github.com/Naguissa)
* https://www.foroelectro.net/electronica-digital-microcontroladores-f8/usevensegmentlib-libreria-arduino-para-controlar-d-t193.html
* https://www.naguissa.com## Contribute ##
Any code contribution, report or comment are always welcome. Don't hesitate to use GitHub for that.
* You can sponsor this project using GitHub's Sponsor button: https://github.com/Naguissa/uSevenSegmentLib
* You can make a donation via PayPal: https://paypal.me/foroelectroThanks for your support.
Contributors hall of fame: https://www.foroelectro.net/hall-of-fame-f32/contributors-contribuyentes-t271.html