hasnain99 / tm1638-library

Automatically exported from code.google.com/p/tm1638-library
0 stars 0 forks source link

Individually turn LED's off #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I can't find a way to turn one led off without messing with the status of the 
others. I'm trying to find a way to make this work:

      if (ch1 == 1) {
        module.setLED(TM1638_COLOR_GREEN, 0); // set LED 0 to green
      } else {
        //something that turns ONLY led number 0 off
    }
      if (ch2 == 1) {
        module.setLED(TM1638_COLOR_GREEN, 1); // set LED 1 to green
      } else {
        //something that turns ONLY led number 1 off
    }

Thank you! Obrigado!

Original issue reported on code.google.com by ggald...@g2tec.me on 6 Nov 2012 at 2:33

GoogleCodeExporter commented 9 years ago
Yes:

module.setLED(0, 1);

would clear that LED.

I've added a new define TM1638_COLOR_NONE (available on v2.1.3) for clarity.

you can now do:
 module.setLED(TM1638_COLOR_NONE, 1); // set LED number 1 off

Original comment by rjbati...@gmail.com on 6 Nov 2012 at 10:06