1 Commits

Author SHA1 Message Date
rjbatista@gmail.com
047b00f790 Version 1.5.0 2011-12-04 01:28:43 +00:00
5 changed files with 12 additions and 11 deletions

View File

@@ -1,12 +1,3 @@
Version 1.5.2
- ISSUE #9: Backwards compatibility with previous Arduino IDE.
Version 1.5.1
- ISSUE #7: New character data in default font for '*';
- Minor optimization on inverted TM1638.
Version 1.5.0 Version 1.5.0
- support for inverted module; - support for inverted module;

View File

@@ -53,5 +53,9 @@ byte InvertedTM1638::getButtons()
void InvertedTM1638::sendChar(byte pos, byte data, boolean dot) void InvertedTM1638::sendChar(byte pos, byte data, boolean dot)
{ {
TM1638::sendChar(7 - pos, data & 0xC0 | (data & 0x07) << 3 | (data & 0x38) >> 3, dot); byte n = data;
n = n & 128 | n & 64 | (n & 4) << 3 | (n & 2) << 3 | (n & 1) << 3 | (n & 32) >> 3 | (n & 16) >> 3 | (n & 8) >> 3;
TM1638::sendChar(7 - pos, n, dot);
} }

View File

@@ -49,6 +49,11 @@ TM1638::TM1638(byte dataPin, byte clockPin, byte strobePin, boolean activateDisp
digitalWrite(strobePin, HIGH); digitalWrite(strobePin, HIGH);
} }
TM1638::~TM1638()
{
// nothing to do
}
void TM1638::setupDisplay(boolean active, byte intensity) void TM1638::setupDisplay(boolean active, byte intensity)
{ {
sendCommand(0x80 | (active ? 8 : 0) | min(7, intensity)); sendCommand(0x80 | (active ? 8 : 0) | min(7, intensity));

View File

@@ -35,6 +35,7 @@ class TM1638
public: public:
/** Instantiate a tm1638 module specifying the display state, the starting intensity (0-7) data, clock and stobe pins. */ /** Instantiate a tm1638 module specifying the display state, the starting intensity (0-7) data, clock and stobe pins. */
TM1638(byte dataPin, byte clockPin, byte strobePin, boolean activateDisplay = true, byte intensity = 7); TM1638(byte dataPin, byte clockPin, byte strobePin, boolean activateDisplay = true, byte intensity = 7);
virtual ~TM1638();
/** Set the display (segments and LEDs) active or off and intensity (range from 0-7). */ /** Set the display (segments and LEDs) active or off and intensity (range from 0-7). */
void setupDisplay(boolean active, byte intensity); void setupDisplay(boolean active, byte intensity);

View File

@@ -74,7 +74,7 @@ const byte FONT_DEFAULT[] = {
0b00000010, // (39) ' 0b00000010, // (39) '
0b00110000, // (40) ( 0b00110000, // (40) (
0b00000110, // (41) ) 0b00000110, // (41) )
0b01100011, // (42) * 0b00000000, // (42) *
0b00000000, // (43) + 0b00000000, // (43) +
0b00000100, // (44) , 0b00000100, // (44) ,
0b01000000, // (45) - 0b01000000, // (45) -