Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of APA102 by
Revision 3:a1d3dbde7004, committed 2018-05-14
- 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);