TLC5940 library which supports SWSPI, has API to specify grayscale PWM period and has API like Arduino library.

Fork of TLC5940 by Stefan Nielsen

Files at this revision

API Documentation at this revision

Comitter:
deton
Date:
Sun Oct 18 12:06:51 2015 +0000
Parent:
5:c35b2b62f2f3
Commit message:
Avoid unexpected refresh in flush() for use of GS PWM as blink.; Otherwise, blink period varies.

Changed in this revision

TLC5940.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/TLC5940.cpp	Sat Oct 17 06:52:23 2015 +0000
+++ b/TLC5940.cpp	Sun Oct 18 12:06:51 2015 +0000
@@ -41,10 +41,14 @@
         _spi.write(gs_data[i]);
     }
 
-    _blank.write(1);
+    if (!_gspwmcycle_repeat) {  // avoid unexpected refresh for use of GS PWM as blink
+        _blank.write(1);
+    }
     _xlat.write(1);
     _xlat.write(0);
-    _blank.write(0);
+    if (!_gspwmcycle_repeat) {
+        _blank.write(0);
+    }
 }
 
 template<typename T>