I wanted to use Larson Scanner, Anyone? - LEDs and Multiplexing - Arduino Forum for my scanner project, and I wanted to make it small so I could deadbug them and fit them inside a LEGO KITT. I have checked a few other Larson scanner examples but on an ATTiny84 they either flickered badly or didn't fade right, I guess it's the limitation of using a smaller CPU half the size of '328p
ATTiny84 used different PORT assigning than '328p and fortunately it was a simple matter of changing all 'D' to 'A' and leaving 'B' I didn't use digital pin 0 or 11 because the 10 LEDs version used up 448 out of max 512 byte RAM.
I am sure there are more efficient code somewhere but as I mentioned, slower CPU doesn't handle software PWM well and other didn't look as good.
//
// PORTAB_larsen2ways modified from
// http://forum.arduino.cc/index.php?topic=171567.0
//
// goes both ways: Back AND Forth :)
//
// 1
// 0987654321
const word dimbits[] = { 0b0000000001111000, // frame 1
0b0000000001110000,
0b0000000001100000,
0b0000000001100000,
0b0000000001000000,
0b0000000001000000,
0b0000000001000000,
0b0000000001000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 098765432
0b0000000011110000, // frame 2
0b0000000011100000,
0b0000000011000000,
0b0000000011000000,
0b0000000010000000,
0b0000000010000000,
0b0000000010000000,
0b0000000010000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 0987654321
0b0000000111100000, // frame 3
0b0000000111000000,
0b0000000110000000,
0b0000000110000000,
0b0000000100000000,
0b0000000100000000,
0b0000000100000000,
0b0000000100000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 0987654321
0b0000001111000000, // frame 4
0b0000001110000000,
0b0000001100000000,
0b0000001100000000,
0b0000001000000000,
0b0000001000000000,
0b0000001000000000,
0b0000001000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 0987654321
0b0000011110000000, // frame 5
0b0000011100000000,
0b0000011000000000,
0b0000011000000000,
0b0000010000000000,
0b0000010000000000,
0b0000010000000000,
0b0000010000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 0987654321
0b0000011100000000, // frame 6
0b0000011000000000,
0b0000011000000000,
0b0000011000000000,
0b0000001000000000,
0b0000001000000000,
0b0000001000000000,
0b0000001000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
// 0987654321
0b0000011100000000, // frame 7
0b0000011100000000,
0b0000001100000000,
0b0000001100000000,
0b0000000100000000,
0b0000000100000000,
0b0000000100000000,
0b0000000100000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,
0b0000000000000000,