Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 6.35 KB

README.md

File metadata and controls

90 lines (65 loc) · 6.35 KB

sevenSegmentDisplay

Compatible architecture: ALL

Description

This library allows to drive both common-anode or common-cathode 7 segment displays.

Sintax & short command reference

  • Creating an istance

    sevenSegmentDisplay name(displayType, A, B, C, D, E, F, G, DP);

    name : the name of the object
    displayType : the type of the display, it can be one of these constants: COMMON_ANODE or COMMON_CATHODE

    The arguments from A to G are the pins were the relative display's segment is attached, DP is the decimal point

  • Drawing a symbol on the display

    name.set(symbol);

    symbol : the symbol that will be displayed on the display, it can be one of the alphanumeric characters in the following table:

    N.B: THE LETTERS MUST BE SPECIFIED INTO SINGLE QUOTES e.g. name.set('A');

    Character Symbol
    0 symbol0
    1 symbol1
    2 symbol2
    3 symbol3
    4 symbol4
    5 symbol5
    6 symbol6
    7 symbol7
    8 symbol8
    9 symbol9
    'A' symbol_A
    'b' symbol_b
    'C' symbol_C
    'c' symbol_c
    'd' symbol_d
    'E' symbol_E
    'F' symbol_F
    'H' symbol_H
    'I' symbol_I
    'J' symbol_J
    'L' symbol_L
    'n' symbol_n
    'o' symbol_o
    'P' symbol_P
    'q' symbol_q
    'r' symbol_r
    't' symbol_t
    'U' symbol_U
  • Manually setting the display's segments

    name.setSegment(segment, value);

    segment : a letter from A to G or DP, that identify a segment on the display

    N.B: This argument is not case sensitive but, except for DP, THE SEGMENT MUST BE SPECIFIED INTO SINGLE QUOTES e.g. name.setSegment('A');

    value : the state of the segment, it can be HIGH or LOW

  • Turning off the display

    name.off();

LICENSE

Creative Commons License
The sevenSegmentDisplay Library by Giuseppe Masino is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

If you need permissions that are beyond the scope of this license, you can ask me through this contacts, in order of preference:

The license text can be found in the LICENSE.md file