12_neopixel_led_strip
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 12_neopixel_led_strip [2026/08/02 13:45] – [Knight Rider Lights] walkeradmin | 12_neopixel_led_strip [2026/08/02 13:48] (current) – [Knight Rider Lights] walkeradmin | ||
|---|---|---|---|
| Line 539: | Line 539: | ||
| And this is what the line that makes the count to backwards actually does. | And this is what the line that makes the count to backwards actually does. | ||
| + | |||
| + | < | ||
| + | range(NUM_LEDS - 2, 0, -1) | ||
| + | #Breakdown for NUM_LEDS = 12: | ||
| + | |||
| + | Start: NUM_LEDS - 2 → 10 | ||
| + | #(LED 11 was already lit in the forward chase) | ||
| + | |||
| + | Stop: 0 | ||
| + | #(but Python stops before 0, so last value is 1) | ||
| + | |||
| + | Step: -1 | ||
| + | #(count backwards) | ||
| + | </ | ||
| + | |||
| + | For the reverse sequence, we don't need to worry about the first (0) or last (11) LEDs as these are already set by the forward sequence. | ||
| \\ | \\ | ||
| \\ | \\ | ||
| - | range(NUM_LEDS - 2, 0, -1) \\ | + | That's it! Oh, and don't worry, I won't be fitting these to my car :) |
| - | Breakdown for NUM_LEDS = 12: | + | |
| - | \\ | + | |
| - | \\ | + | |
| - | Start: NUM_LEDS - 2 → 10 \\ | + | |
| - | (LED 11 was already lit in the forward chase) | + | |
| - | \\ | + | |
| - | \\ | + | |
| - | Stop: 0 \\ | + | |
| - | (but Python stops before 0, so last value is 1) | + | |
| - | \\ | + | |
| - | \\ | + | |
| - | Step: -1 \\ | + | |
| - | (count backwards) | + | |
| \\ | \\ | ||
| \\ | \\ | ||
| ---- | ---- | ||
12_neopixel_led_strip.1785678330.txt.gz · Last modified: by walkeradmin
