Bkap / APA102

Fork of APA102 by Joel Rosiene

Files at this revision

API Documentation at this revision

Comitter:
vrou44
Date:
Mon May 14 12:33:19 2018 +0000
Parent:
2:b8dc9a84801c
Commit message:
Changes for Book And Plug Proto

Changed in this revision

APA102.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/APA102.cpp	Wed Mar 11 14:25:18 2015 +0000
+++ b/APA102.cpp	Mon May 14 12:33:19 2018 +0000
@@ -24,14 +24,15 @@
     
 void APA102::Repaint()
 {   
-    int index;
+//    int index;
     unsigned int val;
     
     _spi.write(0X00);  // Start
     _spi.write(0X00);
     _spi.write(0X00);
     _spi.write(0X00);
-    
+ 
+ #if 0   
     for(int r = 0;r<NR;r++)
     {
         for(int c = off;c<(NC+off);c++)
@@ -52,6 +53,18 @@
             _spi.write(val&0xFF);  
         }
     }
+#else
+
+    for (int i = 0 ; i < NC ; ++i) {
+            val = Buf[i] ;
+            _spi.write((val>>24)&0xFF);  
+            _spi.write((val>>16)&0xFF);  
+            _spi.write((val>>8)&0xFF);  
+            _spi.write(val&0xFF);  
+    }
+
+
+#endif
     _spi.write(0XFF); // Stop
     _spi.write(0XFF);
     _spi.write(0XFF);