This is an example program for the PololuLedStrip library. It generates a simple moving gradient pattern.
Dependencies: PololuLedStrip mbed LedStripGradient
Dependents: LedStripGradient led_phare_crf
For more information, see the PololuLedStrip library.
Revision 9:b1c530cad69b, committed 2013-02-26
- Comitter:
- DavidEGrayson
- Date:
- Tue Feb 26 23:23:02 2013 +0000
- Parent:
- 8:a179aad4fa2e
- Child:
- 10:557ad654e667
- Commit message:
- Achieved nice control of an LED strip!
Changed in this revision
led_strip.s | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/led_strip.s Tue Feb 26 03:12:26 2013 +0000 +++ b/led_strip.s Tue Feb 26 23:23:02 2013 +0000 @@ -83,7 +83,6 @@ nop nop nop - nop it cc strcc r3, [r2] ; Drive the line low. @@ -149,6 +148,10 @@ nop nop nop + nop + nop + nop + it cs strcs r3, [r2] ; Drive the line low. @@ -202,6 +205,74 @@ nop nop nop + nop + nop + nop + nop + nop + + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + + nop + nop + nop + nop + nop + nop + nop sub r7, r7, #1 ; Decrement the loop counter. cbz r7, led_strip_asm_end ; If we have sent 24 bits, go to the end.
--- a/main.cpp Tue Feb 26 03:12:26 2013 +0000 +++ b/main.cpp Tue Feb 26 23:23:02 2013 +0000 @@ -60,6 +60,7 @@ DigitalOut led2(LED2); Timer timer; +AnalogOut signal(p18); int main() { @@ -68,6 +69,8 @@ while(1) { uint8_t time = timer.read_ms() >> 2; + signal.write_u16(time << 8); + for(uint8_t i = 0; i < LED_COUNT; i++) { uint8_t x = time - 8*i;