WS2812B
Dependents: high speed light Bracelet
Fork of PololuLedStrip by
Diff: PololuLedStrip.cpp
- Revision:
- 9:6ffb85d69eaf
- Parent:
- 8:1578776ceac5
- Child:
- 10:f1bb84b97788
--- a/PololuLedStrip.cpp Fri Mar 01 02:05:21 2013 +0000 +++ b/PololuLedStrip.cpp Fri Mar 01 03:57:49 2013 +0000 @@ -10,7 +10,7 @@ int f_mhz = SystemCoreClock / 1000000; // Arrange for a 700 nanosecond delay between the rise time and the fall time for a 0 bit. - led_strip_write_delays[0] = 700*f_mhz/1000 - 25; + led_strip_write_delays[0] = 700*f_mhz/1000 - 25 - 5; // Arrange for a 600 nanosecond delay between the fall time for a 0 bit and the fall time for a 1 bit. // This means the pulses representing a 1 will be 700+600 = 1300 nanoseconds. @@ -34,8 +34,9 @@ while(count--) { - led_strip_write_color(colors++, gpio.reg_set, gpio.reg_clr, gpio.mask); - + led_strip_write_color(colors, gpio.reg_set, gpio.reg_clr, gpio.mask); + colors++; + if (interruptFriendly) { __enable_irq(); @@ -48,4 +49,8 @@ __enable_irq(); // Re-enable interrupts now that we are done. wait_us(24); // Hold the line low for 24 microseconds to send the reset signal. + + //*(gpio.reg_set) = gpio.mask; + //*(gpio.reg_clr) = gpio.mask; + } \ No newline at end of file