looking for lightning code for attiny85

As the title states. I’ve looked around but it all seems to be applicable to rgb led strips. I want single led lighting …/ …lightning :sunglasses:

I prefer something that can be used in ArduinoIDE.

Thanks for any help

What exactly do you want the code to do?

lightning effect like in the andruil UI

So maybe possible to extract it from Anduril code?

I’m a numpty when it comes to digital stuff. Can you explain how to do that please :stuck_out_tongue:


Here you go:
https://github.com/YuvalSob/CavingHeadlampsFW/tree/main/Lightning

T
ested it on Attiny13, hope 85 will also work

Awesome! Thanks YuvalS, I’ll try it when i get home from work :beer:

I tried to flash the attiny85 but no success. It seems to upload to the chip fine but doesn’t light the led. Does it matter that i’m only using pin5 (PB0) for output?

Sorry i am not by the computer now.

Try replacing ALL OCR0B to OCR0A

I literally just tried that while i was waiting. Didn’t work, of course :frowning:

If you replaced all 4 occurrence I have no other idea and need my computer for debug

“All 4 occurrence”…??? There was only 2 lines with TCCR0A
DDRB = 0; // Reset all pins to input
DDRB |= (1 << DDB1); // Set pin 6 (PB1) to output (1)
DDRB |= (1 << DDB0); // Set pin 5 (PB0) to output (1)
// PWN configuration
TCCR0A = 0b10100001;
TCCR0B = 0b00000001;

No sir, please have a look on lines 44, 54, 63, 72 and change OCR0B -> OCR0A
(Undo all your previous changes)

YES!!! That worked. Thank you very much YuvalS :beer: :beer: