/* ATtiny85 PWM v2 - see http://www.technoblogy.com/show?2H0K David Johnson-Davies - www.technoblogy.com - 19th October 2021 ATtiny85 @ 8 MHz (internal oscillator; BOD disabled) CC BY 4.0 Licensed under a Creative Commons Attribution 4.0 International license: http://creativecommons.org/licenses/by/4.0/ */ uint8_t Level[12] = {1, 1, 3, 7, 15, 31, 63, 31, 15, 7, 3, 1 }; uint8_t Order[12] = {0, 1, 2, 5, 4, 3, 8, 7, 6, 9, 10, 11 }; // Timer/Counter1 overflow interrupt ISR(TIM1_COMPA_vect) { static uint8_t first, ramp, column, bits, colbit; ramp = (ramp+1) & 0x3F; // Count from 0 to 63 if (ramp == 0) { bits = 0x07; // All on column = (column + 1) & 0x03; first = column * 3; // First LED in this column colbit = 1<0; i--) Level[Order[i]] = Level[Order[i-1]]; Level[Order[0]] = temp; delay(100); }