7 segment display library for mbed This routine support 2,4 and 8 digit anode-common or cathode-common LED.
Diff: Sseg.cpp
- Revision:
- 11:8be75770e375
- Parent:
- 10:1b8dbe52e5a8
- Child:
- 12:59ac7a4f3d9c
--- a/Sseg.cpp Sun Jul 05 07:21:33 2015 +0000 +++ b/Sseg.cpp Sun Jul 05 07:41:22 2015 +0000 @@ -298,9 +298,9 @@ mask = 0x80; for(i=0;i<8;i++){ if(data & mask){ - _segPins[i]->write((_kcommon == 0) ? 0 : 1); + _segPins[i]->write(((_kcommon) || (_sinkDriver)) ? 0 : 1); }else{ - _segPins[i]->write((_kcommon == 0) ? 1 : 0); + _segPins[i]->write(((_kcommon) || (_sinkDriver)) ? 1 : 0); } mask >>= 1; }