Compatible architecture: ALL
This library allows to drive both common-anode or common-cathode 7 segment displays.
-
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_CATHODEThe 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 1 2 3 4 5 6 7 8 9 'A' 'b' 'C' 'c' 'd' 'E' 'F' 'H' 'I' 'J' 'L' 'n' 'o' 'P' 'q' 'r' 't' '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();
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:
- Telegram : https://telegram.me/qub1750ul
- Twitter : https://twitter.com/qub1750ul
- Facebook page : https://facebook.com/dev.giuseppemasino/
The license text can be found in the LICENSE.md file