8 Commits

Author SHA1 Message Date
rjbatista@gmail.com
fb20d59b73 Version 2.1.2 2012-06-11 21:39:22 +00:00
rjbatista@gmail.com
1508d99abb Version 2.1.2 2012-06-11 21:38:49 +00:00
rjbatista@gmail.com
b779a65eb9 ISSUE #22: corrected setDisplayDigit repeatedly with the dot set to true 2012-06-11 21:16:15 +00:00
rjbatista@gmail.com
7a94b31533 ISSUE #24: Correction on setDisplayToDecNumber bug (thanks to hbx3485); 2012-06-11 21:07:45 +00:00
rjbatista@gmail.com
e4a7aad4d7 ISSUE #24: Correction on setDisplayToDecNumber bug (thanks hbx3485) 2012-06-11 21:05:16 +00:00
rjbatista@gmail.com
5756b7ae7d 2012-03-13 00:05:08 +00:00
rjbatista@gmail.com
da0b7ec9e2 Version 2.1.1 2012-03-12 23:59:00 +00:00
rjbatista@gmail.com
8ba4623718 ISSUE #21: Problems on clearDisplay and setupDisplay 2012-03-12 23:58:28 +00:00
5 changed files with 34 additions and 1 deletions

View File

@@ -1,3 +1,12 @@
Version 2.1.2
- ISSUE #22: corrected setDisplayDigit repeatedly with the dot set to true;
- ISSUE #24: Correction on setDisplayToDecNumber bug (thanks to hbx3485).
Version 2.1.1
- ISSUE #21: Problems on clearDisplay and setupDisplay.
Version 2.1.0 Version 2.1.0
- ISSUE #20: Support for negative decimal numbers; - ISSUE #20: Support for negative decimal numbers;

View File

@@ -68,7 +68,7 @@ void TM1638::setDisplayToDecNumberAt(unsigned long number, byte dots, byte start
void TM1638::setDisplayToDecNumber(unsigned long number, byte dots, boolean leadingZeros, void TM1638::setDisplayToDecNumber(unsigned long number, byte dots, boolean leadingZeros,
const byte numberFont[]) const byte numberFont[])
{ {
setDisplayToDecNumberAt(number, dots, leadingZeros, 0, numberFont); setDisplayToDecNumberAt(number, dots, 0, leadingZeros, numberFont);
} }
void TM1638::setDisplayToSignedDecNumber(signed long number, byte dots, boolean leadingZeros, void TM1638::setDisplayToSignedDecNumber(signed long number, byte dots, boolean leadingZeros,

View File

@@ -35,4 +35,20 @@ TM1640::TM1640(byte dataPin, byte clockPin, boolean activateDisplay, byte intens
void TM1640::sendChar(byte pos, byte data, boolean dot) void TM1640::sendChar(byte pos, byte data, boolean dot)
{ {
sendData(pos, data | (dot ? 0b10000000 : 0)); sendData(pos, data | (dot ? 0b10000000 : 0));
// necessary for the TM1640
digitalWrite(strobePin, LOW);
digitalWrite(clockPin, LOW);
digitalWrite(clockPin, HIGH);
digitalWrite(strobePin, HIGH);
}
void TM1640::clearDisplay()
{
digitalWrite(strobePin, LOW);
send(0xC0);
for (int i = 0; i < 16; i++) {
send(0x00);
}
digitalWrite(strobePin, HIGH);
} }

View File

@@ -33,6 +33,8 @@ class TM1640 : public TM16XX
public: public:
/** Instantiate a tm1640 module specifying the display state, the starting intensity (0-7) data and clock pins. */ /** Instantiate a tm1640 module specifying the display state, the starting intensity (0-7) data and clock pins. */
TM1640(byte dataPin, byte clockPin, boolean activateDisplay = true, byte intensity = 7); TM1640(byte dataPin, byte clockPin, boolean activateDisplay = true, byte intensity = 7);
/** Clear the display */
virtual void clearDisplay();
protected: protected:
virtual void sendChar(byte pos, byte data, boolean dot); virtual void sendChar(byte pos, byte data, boolean dot);

View File

@@ -54,6 +54,12 @@ TM16XX::TM16XX(byte dataPin, byte clockPin, byte strobePin, byte displays, boole
void TM16XX::setupDisplay(boolean active, byte intensity) void TM16XX::setupDisplay(boolean active, byte intensity)
{ {
sendCommand(0x80 | (active ? 8 : 0) | min(7, intensity)); sendCommand(0x80 | (active ? 8 : 0) | min(7, intensity));
// necessary for the TM1640
digitalWrite(strobePin, LOW);
digitalWrite(clockPin, LOW);
digitalWrite(clockPin, HIGH);
digitalWrite(strobePin, HIGH);
} }
void TM16XX::setDisplayDigit(byte digit, byte pos, boolean dot, const byte numberFont[]) void TM16XX::setDisplayDigit(byte digit, byte pos, boolean dot, const byte numberFont[])