This functions sets up the 7 segments display. It requires information on every pin used to control the 7-segment display.
set(byte enableZB, byte noOfDigits, byte *digitPins, byte *segmentPins)
enableZB: enable zero blanking. If a number is displayed on the display which requires less than 4 digits the leading 0's are blanked out.
noOfDigits: number of digits used. In case of LogicStart MegaWing the number is 5 as the colon and apostrophe form the 5th digit.
digitPins: array of pin numbers that control each digit. The order must the LSB to MSB and the length of the array must confirm to the noOfDigits parameter.
segmentPins: array of pin numbers that control the digit segments. The order must be 'a' through 'g' followed by dot.
(:source:)
byte digitPins[] = {11, 8, 2, 0, 28}; // LSB to MSB byte segmentPins[] = {7, 10, 5, 6, 3, 4, 9, 1}; // seg a to g and DP
Multiplex7SegSW sevenseg1;
void setup() {
Multiplex7SegSW sevenseg1;.set(1, noOfDigits, digitPins, segmentPins);
}
void loop() {}
(:sourceend:)
This text is from the Papilio reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.