I want to control ws2812 led strip from c# app. Just set diffrent collors for each of LED's
I am having a problem with compiling this code for arduino
#include <FastSPI_LED.h>
#define NUM_LEDS 7
#define LED_PIN 2
struct CRGB {
unsigned char g;
unsigned char r;
unsigned char b;
};
struct CRGB *leds;
int leds_idx;
int leds_color;
void setup() {
// Setup serial communication
Serial.begin(57600);
// Setup FastSPI_LED library: number of leds, chipset and Arduino PIN
FastSPI_LED.setLeds(NUM_LEDS);
FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2811);
FastSPI_LED.setPin(LED_PIN);
// Init FastSPI_LED library
FastSPI_LED.init();
FastSPI_LED.start();
// Get data array and turn all the LEDs off
leds = (struct CRGB*)FastSPI_LED.getRGBData();
memset(leds, 0, NUM_LEDS * 3);
FastSPI_LED.show();
// Init array index and color index
leds_idx = 0;
leds_color = 0;
}
void loop() {
if (Serial.available() > 0) {
char input_byte = Serial.read();
//If LF was sent, the transmission is completed
if(input_byte == 0x0A) {
FastSPI_LED.show();
leds_idx = 0;
leds_color = 0;
}
else {
// Save the received byte to the corresponding LED and color
switch(leds_color) {
case 0:
leds[leds_idx].r = input_byte;
leds_color = 1;
break;
case 1:
leds[leds_idx].g = input_byte;
leds_color = 2;
break;
case 2:
leds[leds_idx].b = input_byte;
leds_color = 0;
leds_idx++;
break;
}
}
}
}
And I am getting this error log
In function 'spilpd6803':
C:\Users\Student\Documents\Arduino\libraries\MD_Serial_LED_Strips-master\FastSPI_LED.cpp:437:1: warning: 'spilpd6803' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
ISR(spilpd6803)
^
In function 'spi595':
C:\Users\Student\Documents\Arduino\libraries\MD_Serial_LED_Strips-master\FastSPI_LED.cpp:395:1: warning: 'spi595' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
ISR(spi595)
^
In function 'spihl1606':
C:\Users\Student\Documents\Arduino\libraries\MD_Serial_LED_Strips-master\FastSPI_LED.cpp:364:1: warning: 'spihl1606' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
ISR(spihl1606)
^
C:\Users\STUDEN~1\AppData\Local\Temp\ccX7p3LR.ltrans1.ltrans.o: In function `__vector_13':
C:\Users\Student23171\Documents\Arduino\libraries\MD_Serial_LED_Strips-master/FastSPI_LED.cpp:342: undefined reference to `nChip'
collect2.exe: error: ld returned 1 exit status
exit status 1
.
I don't know exactly what is wrong. As far as I know the FastSPI_LED library was updated for FastLED.h. However code does not work with newer library either. FastSPI is hard to find lib, I think there might be problem with one that I have. I tried to use different versions FastLED but none of them worked. Is there a solution of this problem? I can post this library that i have in rar file if that would help solving the problem