TM1638 LED controller. Max 80 LEDs, Max 24 Key scan. Supports LED&KEY, QYF-TM1638 and JY-LKM1638 module.
Dependents: mbed_TM1638 Otjimaniya RL0201-V1
See here for more information.
Revision 3:25ddabfadc8c, committed 2016-01-19
- Comitter:
- wim
- Date:
- Tue Jan 19 18:58:22 2016 +0000
- Parent:
- 2:532ce15ea9ec
- Child:
- 4:b2bbdc58967e
- Commit message:
- Added animation demo for Jeroen
Changed in this revision
TM1638.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/TM1638.cpp Fri Jan 15 19:09:59 2016 +0000 +++ b/TM1638.cpp Tue Jan 19 18:58:22 2016 +0000 @@ -190,6 +190,7 @@ * @param char data * @return bitreversed data */ +#if(1) char TM1638::_flip(char data) { char value=0; @@ -203,7 +204,14 @@ if (data & 0x80) {value |= 0x01;} ; return value; } +#else +char TM1638::_flip(char data) { + data = (((data & 0xAA) >> 1) | ((data & 0x55) << 1)); + data = (((data & 0xCC) >> 2) | ((data & 0x33) << 2)); + return (((data & 0xF0) >> 4) | ((data & 0x0F) << 4)); +} +#endif /** Write command and parameter to TM1638 * @param int cmd Command byte