How to use the library¶
Class Dokumentation¶
-
class
SegmentDisplay
¶ 6-digit-7-Segment-Arduino-Library
A Arduino-Library that allows you to easily controll a 6-digit 7-Segment Multiplex Matrix (e.g. E60301-L-O-0-W) with a 8-Bit-Shiftregister (e.g. M74HC595)
- Author
- SohnyBohny
- Version
- 2.0.0
- Date
- 2016-05-05
- Copyright
- GNU GENERAL PUBLIC LICENSE Version 3
Public Functions
-
SegmentDisplay
(int latchPin, int clockPin, int dataPin, int digit1, int digit2, int digit3, int digit4, int digit5, int digit6, int punkt)¶ Constructor: all Pins will be set.
- Parameters
latchPin
-this int saves the latchPin used for ShiftRegister
clockPin
-this int saves the clockPin used for ShiftRegister
dataPin
-this int saves the dataPin used for ShiftRegister
digit1
-this int saves the kathote of digit1 of the display
digit2
-this int saves the kathote of digit2 of the display
digit3
-this int saves the kathote of digit3 of the display
digit4
-this int saves the kathote of digit4 of the display
digit5
-this int saves the kathote of digit5 of the display
digit6
-this int saves the kathote of digit6 of the display
punkt
-this int saves the anothe of the punkt of the display
-
void
showString
(String string)¶ show a String on Display
- Parameters
string
-String showing on the Display
-
bool
isLegal
(char check)¶ check if charakter is legal
- Return
- bool - true if legal
- Parameters
char
-to check
-
void
showChar
(char displayResorce[6][2], int delayTime)¶ to talk with the display
- Parameters
displayResorce[6][2]
-the char array contains the numbers showing on the Display
delayTime
-this int contains the time while the numbers are showed
-
void
updateShiftRegister
(byte b)¶ update the 8-Bit ShiftRegister
- Parameters
b
-this byte contains the information: state of the pins
This documentation was built using ArduinoDocs.
What’s about displayResorce[6][2]¶
First dimension | |
---|---|
Call | Output |
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
C | |
F | |
o | |
A | |
b | |
C | |
d | |
E | |
F | |
G | |
H | |
I | |
J | |
L | |
U | |
c | |
h | |
n | |
O | |
r | |
t | |
u | |
p | |
y |
Example¶
#include <SegmentDisplay.h>
int latchPin = 9; // Shiftregister
int clockPin = 10;
int dataPin = 8;
int digit1 = 6; // cathode of the digits
int digit2 = 1;
int digit3 = 2;
int digit4 = 3;
int digit5 = 4;
int digit6 = 5;
int punkt = 7; // anode of the DP
SegmentDisplay segmentDisplay(latchPin, // tell the library the pins -> pinMode will be called
clockPin,
dataPin,
digit1,
digit2,
digit3,
digit4,
digit5,
digit6,
punkt);
void setup() {
}
void loop() {
char tempTest[6][2] = {
{'1', '.'},
{'2', 'X'},
{'3', '.'},
{'4', 'X'},
{'5', '.'},
{'6', 'X'}
};
segmentDisplay.showChar(tempTest , 1000); // call display to show "1.23.45.6" for 1s
}