49 TM1637::TM1637(uint8_t clkPin, uint8_t dioPin,
bool displayOn, uint8_t brightness) :
50 _displayOn(displayOn), _brightness((uint8_t)(brightness & 0x07))
54 _clkPort = digitalPinToPort(clkPin);
55 _dioPort = digitalPinToPort(dioPin);
57 _clkBit = digitalPinToBitMask(clkPin);
58 _dioBit = digitalPinToBitMask(dioPin);
126 if (brightness <= 7) {
178 for (uint8_t i = 0; i < len; i++) {
202 if (keyCode != 0xFF) {
214 keyCode = (uint8_t)((keyCode & 0x80) >> 7 |
215 (keyCode & 0x40) >> 5 |
216 (keyCode & 0x20) >> 3 |
278 for (uint8_t i = 0; i < 8; i++) {
326 for (uint8_t bit = 0; bit < 8; bit++) {
#define TM1637_DIO_INPUT()
DIO pin input.
#define TM1637_CLK_OUTPUT()
CLK pin output.
#define TM1637_DIO_OUTPUT()
DIO pin output.
#define TM1637_NUM_GRIDS
Number of grid registers.
#define TM1637_CTRL_DISPLAY_OFF
Display off.
#define TM1637_CMD_ADDR
Display address command.
#define TM1637_DIO_READ()
DIO pin read.
virtual void writeByte(uint8_t data)
Write byte to TM1637.
#define TM1637_DIO_LOW()
DIO pin low.
virtual void writeData(uint8_t address, uint8_t data)
Write display register.
virtual void start()
Generate start condition.
#define TM1637_CMD_CTRL
Display control command.
virtual uint8_t getKeys()
Get key states.
#define TM1637_DATA_AUTO_INC_ADDR
Auto increment address.
#define TM1637_CLK_INPUT()
CLK pin input.
virtual uint8_t readByte()
Read byte from TM1637.
virtual void end()
Release TM1637 pins.
uint8_t _brightness
Display brightness for display control register.
uint8_t _clkPin
Clock pin.
#define TM1637_PIN_DELAY()
Delay between pin changes.
virtual void writeDisplayControl()
Write display control register.
#define TM1637_CTRL_DISPLAY_ON
Display on.
#define TM1637_CLK_HIGH()
CLK pin high.
virtual void writeCommand(uint8_t cmd)
Write command to TM1637.
virtual void displayOff()
Turn display off.
#define TM1637_DATA_WRITE
Write data.
virtual void clear()
Turn all LED's off.
#define TM1637_DATA_READ_KEYS
Read keys.
virtual void stop()
Generate stop condition.
#define TM1637_CLK_LOW()
CLK pin low.
bool _displayOn
Display on and off status for display control register.
TM1637(uint8_t clkPin, uint8_t dioPin, bool displayOn=true, uint8_t brightness=5)
TM1637 constructor.
#define TM1637_DIO_HIGH()
DIO pin high.
virtual void setBrightness(uint8_t brightness)
Set brightness LED's.
#define TM1637_CMD_DATA
Display data command.
TM1637 library for Arduino.
virtual void displayOn()
Turn Display on.
virtual void begin()
Initialize TM1637 controller.