I have connected four WS2812B modules I got from eBay to my AtMega8 and tried to use the light_ws2812 libray to controll them.
I connected the wire used for communication to the PC5 Pin on my ATMega and wrote the following programm to controll the four LEDs.
#include <util/delay.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "light_ws2812.h"
struct cRGB led[4];
int main(void)
{
led[0].r=255;led[0].g=00;led[0].b=0;
led[1].r=255;led[1].g=00;led[1].b=0;
led[2].r=255;led[2].g=00;led[2].b=0;
led[3].r=255;led[3].g=00;led[3].b=0;
ws2812_setleds(led,4);
while(1)
{
}
}
I followed the given Example of the Libray to write the Code. While trying to figure out the error myself and rewriting my code a little bit, I somehow managed to get the first LED to light up fully green. When I erased the complete flash memory of the ATMega the LED still stayed on.
Because of that I'm pretty sure that my problem is on the software side, but I don't know how to fix it.