Cascaded led driver to write use write into leds[i] = 0x0 or 0xfff
Fork of TLC5940 by
Revision 3:367910365a97, committed 2013-04-05
- Comitter:
- Mach5
- Date:
- Fri Apr 05 16:03:25 2013 +0000
- Parent:
- 2:ff6fc805f4ea
- Commit message:
- projectcode
Changed in this revision
TLC5940.cpp | Show annotated file Show diff for this revision Revisions of this file |
TLC5940.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ff6fc805f4ea -r 367910365a97 TLC5940.cpp --- a/TLC5940.cpp Sat Mar 23 07:15:54 2013 +0000 +++ b/TLC5940.cpp Fri Apr 05 16:03:25 2013 +0000 @@ -7,9 +7,9 @@ xlat = 0; // hold GS/DC data constant blank = 1; blank = 0; // Blank (squelch) all outputs - dcprg = 1; // dcprg points DC data to DC register. + dcprg = 0; // dcprg points DC data to DC register. vprg = 0; // sets drivers to GS mode. Set to 1 to change to DC mode - gsclk.period_ms (1); // set grayscale clock to 1000 Hz + gsclk.period_us (10); // set grayscale clock gsclk = 0.5; // turn on grayscale clock to 50% duty cycle at afore mentioned frequency if (num_ics <= 0) @@ -35,7 +35,7 @@ blank = 1; blank = 0; - for (int i = (32 - 1); i >= 0; i--) + for (int i = (48 - 1); i >= 0; i--) { driver.write (*(LEDS + i)); } @@ -45,4 +45,3 @@ } -
diff -r ff6fc805f4ea -r 367910365a97 TLC5940.h --- a/TLC5940.h Sat Mar 23 07:15:54 2013 +0000 +++ b/TLC5940.h Fri Apr 05 16:03:25 2013 +0000 @@ -3,4 +3,12 @@ void setup (SPI &driver, DigitalOut &vprg, DigitalOut &xlat, DigitalOut &blank, DigitalOut &dcprg, PwmOut &gsclk, int num_ics); void update_led (SPI &driver, DigitalOut &xlat, DigitalOut &blank, unsigned short* LEDS); -void clearall (void); \ No newline at end of file +void clearall (void); +void highall (void); +//ButtonLayout +//[01][02][03][04] +//[05][06][07][08] +//[09][10][11][12] +//[13][14][15][16] +void padpush (int k,int r, int g, int b); +