Attiny45/85 to control RGB LED's

Hi All,

So to break this down neatly;
Setup:

Goal:
The end goal is to drive a small string of RGB LED's (4-10 LEDs) in patterns from the Attiny, with a button for which pattern is selected and a button to cycle through pre-set brightness's. With simplicity of re-programming in mind.

Issue:
I am trying to use the fastLED library to write the code, I have sketches that run on my UNO perfectly fine, but when compiled onto the Attiny do not work.

I am not especially well versed in this subject area, but i am starting to think their is something fundamentally wrong with my approach - I now believe the issue is that the library is doing functions that may be fine on an Atmega328, but that the attiny simply isn't capable of doing (or is something along those lines).

Questions:
Could someone more experienced please point me in the right direction? Is the Attiny going to be capable of what i am asking?

  • Will the Attiny be able to utilise the fastLED library? or would I need to do the bit-banging to the RGB LEDs myself?
  • The end goal is for this to be easy to understand, would I be better off using something like the Atmega238P? it may be a sledgehammer to crack a walnut in regards to driving RGB LEDs, but it would certainly make it more plug and play
  • Is there a more cost-effective chip I could use in this project? I intend to have a small batch of these boards manufactured (<500)

Kind Regards
Solar

How are you powering the LEDS?
Can we see a drawing of your wiring.

People definitely use the FastLED library with the ATtiny85 successfully. The ATtiny45 is the same, but with less memory. If you can compile the sketch for the ATtiny45, then there's no problem with the flash memory, but it is possible you're running out of SRAM.

I frequently see people working with the bare chips having problems with the pin mapping. You need to make sure the pin number you're using in your sketch matches to the pin the LED strip is connected to. The Arduino pin numbers are shown in aqua in the diagram provided by SparkFun:

By the way, I highly recommend ATTinyCore as an alternative to the damellis/attiny hardware package recommended in the SparkFun tutorial. I don't have any reason to believe that damellis/attiny won't work for you, but ATTinyCore provides a much higher level of support and is actively developed. It also supports a huge range of ATtiny chips in case you decide you want to play around with some different parts. It uses the same pin mapping as damellis/attiny so it won't require any change to your code or circuit:

Romonaga:
How are you powering the LEDS?
Can we see a drawing of your wiring.

I am powering the LEDs off of the VCC and GND connections coming from the tiny programmer. This is powered via the USB port on my computer. I do have the means to power the LED's independently, I will hook them up and try again later tonight.

pert:
People definitely use the FastLED library with the ATtiny85 successfully. The ATtiny45 is the same, but with less memory. If you can compile the sketch for the ATtiny45, then there's no problem with the flash memory, but it is possible you're running out of SRAM.

I frequently see people working with the bare chips having problems with the pin mapping. You need to make sure the pin number you're using in your sketch matches to the pin the LED strip is connected to. The Arduino pin numbers are shown in aqua in the diagram provided by SparkFun:

By the way, I highly recommend ATTinyCore as an alternative to the damellis/attiny hardware package recommended in the SparkFun tutorial. I don't have any reason to believe that damellis/attiny won't work for you, but ATTinyCore provides a much higher level of support and is actively developed. It also supports a huge range of ATtiny chips in case you decide you want to play around with some different parts. It uses the same pin mapping as damellis/attiny so it won't require any change to your code or circuit:
GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8

I have also used the AttinyCore package, I will update to that later tonight, i used it originally but when i ran into issues I went back to following the sparkfun guide to the letter (to hopefully see where i was going wrong). I am using the exact pinout as your diagram, using Pin 5 as the 0 pin. I also could see the PWM as there is an on-board LED connected to pin 0, which was pulsing after code upload. I also tried every other pin just in case I had the wrong output.

Well if it is feasible then i suppose this is more of a coding issue.
Mods would it be best to move my post to the programming sub-forum and I will update the post to focus on the coding issues I was having?

Please post your current code and complete schematic of the project (with all components and pins clearly labelled, power supply present, etc). Without that it's just guesswork on what's wrong. With that information it may be a very quick fix.