if (current > 19) charlieON(19); else charlieON(current);so rather than the focus LED which is the head of the animation going off the bottom, it stays at 19 until the animation is complete and the tail has collapsed into it. If you want the head to keep going so the last LED fades, change that line to simply:

charlieON(current);If you want the last LED to fade after the tail goes away, suggest you use the charlieplexing duty cycle to do that. If the Analogwrite is working that is simply good fortune that the particular ATTiny pin referenced in the array at that point is one of the PWM pins. That won't work the length of the array therefore since one of the 5 pins used for controlling the LEDs isn't PWM capable.

I'm surprised by your findings on the randomseed(). Analog pin 0 is actually leg 1 on the chip, which is disconnected. My thoughts were that worst case, even if it always returned the same value as that seed it will still generate a pseudorandom sequence, though it will have a sequence that will repeat every run. It isn't electrically connected to the LEDs so I need convincing it can be playing a part in flashing any lights.

I am not seeing your issue, as yet. Will try to break it tomorrow and report back.

Geoff

"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield

I'm surprised by your findings on the randomseed(). Analog pin 0 is actually leg 1 on the chip, which is disconnected. My thoughts were that worst case, even if it always returned the same value as that seed it will still generate a pseudorandom sequence, though it will have a sequence that will repeat every run. It isn't electrically connected to the LEDs so I need convincing it can be playing a part in flashing any lights.

analog 0 in actually pin 5 on the Attiny... try it with the fade sketch.

I will try tomorrow the thing you said about the fading and also the random generator.

Here's a modification, adding in the entropy library to give a random randomseed(). This has both a randomised delay between snowflakes, and a randomised speed of the drop. I've also added a fade-out for the end after the tail collapses.

// each block of 4 LEDs in the array is groupled by a common anode (+, long leg)// for simplicity of wiring on breadboard, using a colour code#define GREEN 0#define ORANGE 1#define WHITE 2#define BLUE 3#define YELLOW 4

Thanks again to Coding Badly for the random links. I had to use one that was completely internal to the uC since we have no spare legs, and this method will ensure these snowflakes are far more effective where several are side by side.

Cheers ! Geoff

"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield

Glad you've found it useful. I have put this, and my take on a Larson scanner (Knight Rider's KITT) effect using the same 20-LED charlieplex array up on github.https://github.com/strykeroz/ATTiny85-20-LED-KITT

Looking forward to seeing your next project update.

Cheers ! Geoff

"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield

I was wondering about a similar effect I had seen at a shopping centre over christmas. I think there were more LED's than 20 though and the motion looked extremely fluid. I will upload the video I took when I get home

I was wondering about a similar effect I had seen at a shopping centre over christmas. I think there were more LED's than 20 though and the motion looked extremely fluid. I will upload the video I took when I get home

// each block of 4 LEDs in the array is groupled by a common anode (+, long leg)// for simplicity of wiring on breadboard, using a colour code#define GREEN 0#define ORANGE 1#define WHITE 2#define BLUE 3#define YELLOW 4

// otherint current = 0; // LED in array with current focusint previous = 0; // previous LED that was litconst unsigned long displayTime = 15; // milliseconds to spend at each focus LED in descentconst int lineLength = 10; // how many LEDs to light maximum

// --------------------------------------------------------------------------------// turns off LED #thisLED. //void charlieOFF(int thisLED) { digitalWrite(charliePin[LED[thisLED][1]], LOW); // ensure internal pull-ups aren't engaged on INPUT mode pinMode(charliePin[LED[thisLED][0]], INPUT); pinMode(charliePin[LED[thisLED][1]], INPUT);}It just moves a block of lineLength LEDs down the array repeatedly. If nothing else it proves more than 20 LEDs and an ATTiny85 were used in your video

Geoff

"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield

I've created a couple of these - one on a test rig and one permanently which became a KITT type Larsson scanner. To run multiple strands I'll be putting an ATTiny85 at the top of each with Vcc and GND shared across them from a wall wart. While they'll run independently, the slight randomisation in the speed and delay between falls should create a reasonable effect across the windows at the front of our house.

Measuring up the 4 windows I'll be running these in leads me to think I'll need 30 of them, so 600 white LEDs...the project is approved by the minister for finance and war so it's just a matter of sourcing the bits and dedicating the time. I'm actually very happy I have a 10 month project window on delivering this one

Geoff

"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield