Support for display on/off and intensity

This commit is contained in:
rjbatista@gmail.com
2011-08-04 00:25:01 +00:00
parent d1e51e6ffa
commit 1b3265f0cc
3 changed files with 25 additions and 9 deletions

View File

@@ -6,13 +6,13 @@ unsigned char hello[] = {
TM1638 module1(2, 3, 4);
TM1638 module2(2, 3, 5);
unsigned long value = 87654321L;
unsigned long value = 0L;
boolean state = true;
void setup()
{
module1.setDisplay(helloLCD);
module2.setDisplay(helloLCD);
module1.setDisplay(hello);
module2.setDisplay(hello);
module1.setLEDs(0b00011111 | 0b11111000 << 8);
@@ -21,7 +21,6 @@ void setup()
module2.setLED(TM1638_COLOR_RED | TM1638_COLOR_GREEN, 7);
}
void loop()
{
byte key1, key2;
@@ -42,6 +41,13 @@ void loop()
module2.setDisplayToBinNumber(key1, 0);
module1.setLEDs(key1);
if (key1 & 128) {
state = !state;
delay(200); // just wait for button up
}
module1.setupDisplay(state, key1 >> 1);
}
if (key2 != 0) {