Go Down

Topic: I2C WS2812b ATtiny85 (Read 287 times) previous topic - next topic

Sander11cool

Hello,
I'm currently working on a project with a ws2812b led strip that represents the amount of CO2 in the air.
The CO2 is measured by a sensor that is attached to a Raspberry Pi.
To control the led strip, I would like to use an ATtiny85 which is connected to the Raspberry Pi trough an I2C bus.
But when I merge the I2C and the WS2812b library I can't communicate with the Attiny anymore on the bus.

Do you guys know any good library that combines I2C and the WS2812b protocol?

The attached file is what I've tried until now.
Note that some of the variables are named in dutch, but you will probably get the general concept of what I'm trying to achieve.

Thank you in advance, Sander

Qdeathstar

#1
Apr 08, 2019, 11:14 pm Last Edit: Apr 08, 2019, 11:14 pm by Qdeathstar
Hello.

The I2C library and FastLed library (or whichever  ws2812b library you chose).  The issue is you cannot typical just paste two example code snippets together and expect them to work.

You have posted in the wrong place, I suggest asking a moderator to help you move it to "programming questions".


Also, rather than making everyone who wants to help download and open your program you should paste the code in code tags directly to the forums.

Here is a good guide as to how these forum works:

https://forum.arduino.cc/index.php?topic=148850.0
A creaking creeping shadow
stiff against the freezing fog
glares at a tickless watch.

Time has failed him -- all things shall pass.

wvmarle

It probably belongs in Project Guidance, actually.

I recall the old ATtiny85 doesn't have hardware I2C so that and the FastLED library will fight over resources. They may even want to use the same timer, as both I2C and WS2812B communication is time sensitive.

Start by making this work on a regular Arduino (the Pro Mini isn't that much bigger and about the same cost as an ATtiny85 anyway) first. Then try to get it onto an ATtiny.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up