Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte led_pwm_array[16];
- byte no_of_leds = 16;
- byte resolution = 120;
- byte overlap = resolution/2;
- for (byte i = 0; i < no_of_leds; i++){
- led_pwm_array[i] = abs(abs(map(constrain(a0,(i*overlap),((i*overlap)+resolution)),(i*overlap),((i*overlap)+resolution), -255, 255))-255);
- }
- Serial.print(a0);
- for (byte i = 0; i < no_of_leds; i++){
- Serial.print(" ");Serial.print(led_pwm_array[i]);
- }
- Serial.println(" ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement