LPD8806 osc communication
Dependents: LineLedControl LineLedControl2
Fork of LPD8806 by
Revision 3:4ff7fdb41bd2, committed 2013-08-26
- Comitter:
- sfjmt
- Date:
- Mon Aug 26 17:21:49 2013 +0000
- Parent:
- 2:0d8eb41bb976
- Commit message:
- line led cotrol
Changed in this revision
LPD8806.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0d8eb41bb976 -r 4ff7fdb41bd2 LPD8806.cpp --- a/LPD8806.cpp Mon Aug 19 12:12:30 2013 +0000 +++ b/LPD8806.cpp Mon Aug 26 17:21:49 2013 +0000 @@ -17,8 +17,8 @@ //Connected to first SPI module //example...SPI spi(p5, p6, p7); // mosi, miso, sclk (if don't use ... NC(not connected)) -//SPI spi(p5, NC, p7); // mosi, miso, sclk (if don't use ... NC(not connected)) -SPI spi(p11, NC, p13); // mosi(data), miso, sclk(clock) (if don't use ... NC(not connected)) +SPI spi(p5, NC, p7); // mosi, miso, sclk (if don't use ... NC(not connected)) +//SPI spi(p11, NC, p13); // mosi(data), miso, sclk(clock) (if don't use ... NC(not connected)) LPD8806::LPD8806(uint16_t n) { // Allocate 3 bytes per pixel: @@ -32,12 +32,8 @@ // Setup the spi for 8 bit data, low steady state clock, // first edge capture, with a 2MHz clock rate -// spi.format(8,3); -// spi.frequency(2000000); spi.format(8,0); spi.frequency(2000000); -// spi2.format(8,0); -// spi2.frequency(2000000); // Issue initial latch to 'wake up' strip (latch length varies w/numLEDs) writezeros(3 * ((numLEDs + 63) / 64)); @@ -50,7 +46,6 @@ void LPD8806::writezeros(uint16_t n) { while (n--){ spi.write(0x00); -// spi2.write(0x00); } } @@ -63,7 +58,6 @@ for (i=0; i<nl3; i++ ) { spi.write(pixels[i]); -// spi2.write(pixels[i]); } // Write latch at end of data; latch length varies with number of LEDs @@ -71,7 +65,7 @@ // We need to have a delay here, a few ms seems to do the job // shorter may be OK as well - need to experiment :( -// wait_ms(3); + wait_ms(3); } // Convert R,G,B to combined 32-bit color