This library lets you control the addressable RGB LED strips from Pololu Robotics. Forked to add selectable colour order (Support RGB or GRB Leds)
Fork of PololuLedStrip by
Diff: led_strip_write_color.s
- Revision:
- 27:9a62663f3de2
- Parent:
- 24:5c01a6fa1556
--- a/led_strip_write_color.s Wed Nov 01 23:11:49 2017 +0000 +++ b/led_strip_write_color.s Sat May 19 14:16:38 2018 +0000 @@ -28,14 +28,14 @@ ; Push those registers so we can restore them later. push {r4, r5, r6, r7, lr} - ldrb r6, [r0, #1] ; Load green. - lsls r6, r6, #24 ; Put green in MSB of r6. - ldrb r4, [r0, #0] ; Load red. + ldrb r6, [r0, #0] ; Load first colour. + lsls r6, r6, #24 ; Put first colour in MSB of r6. + ldrb r4, [r0, #1] ; Load second colour. lsls r4, r4, #16 - orrs r6, r6, r4 ; Put red in r6. - ldrb r4, [r0, #2] ; Load blue. + orrs r6, r6, r4 ; Put second colour in r6. + ldrb r4, [r0, #2] ; Load third colour. lsls r4, r4, #8 - orrs r6, r6, r4 ; Put blue in r6. + orrs r6, r6, r4 ; Put third colour in r6. ; On the Cortex-M3 we simply did: ; ldr r6, [r0] ; Read the color. Now we have: xxBbGgRr