7segment SPI LED module from DF Robot.com
Revision 2:27cc28619363, committed 2015-02-08
- Comitter:
- morecat_lab
- Date:
- Sun Feb 08 06:46:20 2015 +0000
- Parent:
- 1:fcb72bd26532
- Commit message:
- correct spell mistake
Changed in this revision
| Spi7Seg.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Spi7Seg.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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) {
--- a/Spi7Seg.h Fri Jan 30 22:46:29 2015 +0000
+++ b/Spi7Seg.h Sun Feb 08 06:46:20 2015 +0000
@@ -48,7 +48,7 @@
class Spi7Seg
{
private:
- DigitalOut _dataPin, _clockPin, _ratchPin;
+ DigitalOut _dataPin, _clockPin, _latchPin;
char _buffer[8];
int _numOfDigs;
bool _zeroSupress;
@@ -60,9 +60,9 @@
*
* @param PinName a Pin No for segment data
* @param PinName b Pin No for segment clock
- * @param PinName c Pin No for segment ratch
+ * @param PinName c Pin No for segment latch
*/
- Spi7Seg(PinName data,PinName clock,PinName ratch);
+ Spi7Seg(PinName data,PinName clock,PinName latch);
/**
* start driver
Yoshitaka Kuwata