7segment SPI LED module from DF Robot.com
Diff: Spi7Seg.cpp
- Revision:
- 2:27cc28619363
- Parent:
- 1:fcb72bd26532
--- a/Spi7Seg.cpp Fri Jan 30 22:46:29 2015 +0000
+++ b/Spi7Seg.cpp Sun Feb 08 06:46:20 2015 +0000
@@ -18,12 +18,12 @@
NUM_PAT_C, NUM_PAT_D, NUM_PAT_E, NUM_PAT_F};
// 8 digit
-Spi7Seg::Spi7Seg(PinName data,PinName clock, PinName ratch) :
- _dataPin(data), _clockPin(clock), _ratchPin(ratch) {
+Spi7Seg::Spi7Seg(PinName data,PinName clock, PinName latch) :
+ _dataPin(data), _clockPin(clock), _latchPin(latch) {
_numOfDigs = 8;
_dataPin = 0;
_clockPin = 1;
- _ratchPin = 1;
+ _latchPin = 1;
_zeroSupress = 1;
}
@@ -122,7 +122,7 @@
void Spi7Seg::update(void) {
- _ratchPin = 0;
+ _latchPin = 0;
for (int col = _numOfDigs ; col >= 0 ; col--) { // reverse order
for (int i = 7; i >= 0; i--) {
_clockPin = 0;
@@ -135,7 +135,7 @@
_dataPin = 0;
}
}
- _ratchPin = 1;
+ _latchPin = 1;
}
void Spi7Seg::updateWithDelay(int ms) {
Yoshitaka Kuwata