Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing two problems with chase: An extra LED would be used. The LED aft... #10

Merged
merged 1 commit into from
Sep 16, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixing two problems with chase: An extra LED would be used. The LED a…
…fter the amount specified is turned off each time. Not needed.
  • Loading branch information
hydra committed Sep 16, 2012
commit b3a07c4959f95cc114586a9a1e07e56e3ac55d5f
4 changes: 2 additions & 2 deletions pixelpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ def chase():
pixel_index = 0
while True:
for current_color[:] in RAINBOW:
for pixel_index in range(args.num_leds+1):
for pixel_index in range(args.num_leds):
pixel_output[((pixel_index-2)*PIXEL_SIZE):] = filter_pixel(current_color[:],0.2)
pixel_output[((pixel_index-1)*PIXEL_SIZE):] = filter_pixel(current_color[:],0.4)
pixel_output[((pixel_index)*PIXEL_SIZE):] = filter_pixel(current_color[:], 1)
pixel_output += '\x00'* ((args.num_leds+1-pixel_index)*PIXEL_SIZE)
pixel_output += '\x00'* ((args.num_leds-1-pixel_index)*PIXEL_SIZE)
spidev.write(pixel_output)
spidev.flush()
time.sleep((args.refresh_rate)/1000.0)
Expand Down