Advertisement
Guest User

wave

a guest
Aug 29th, 2014
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. void wave_fx(){
  2. static byte middle = NUM_LEDS/2;
  3.  
  4. currentMillis = millis();
  5. if(currentMillis - previousMillis >= 10) {
  6. if (count++ == 255) {
  7. count = 0;
  8. }
  9. for (byte i = 0; i <= middle; i++) {
  10. wave = sin8((millis() / wave_scale) * i);
  11. leds[i] = CHSV(ihue, 255, wave);
  12. }
  13.  
  14. for(byte i = middle; i < NUM_LEDS; i++){
  15. leds[i] = leds[NUM_LEDS - i];
  16. }
  17. previousMillis = currentMillis;
  18. LEDS.show();
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement