/* Modified and commented by ai.rs
* t4a_boblight
* (C) 2014 Hans Luijten, www.tweaking4all.com
*
* t4a_boblight is free software and can be distributed and/or modified
* freely as long as the copyright notice remains in place.
* Nobody is allowed to charge you for this code.
* Use of this code is entirely at your own risk.
*/

for( int Counter = 0; Counter < sizeof(prefix) - 1; Counter++)
{
if( buffer[Counter] == prefix[Counter+1] )
{
state = STATE_DO_DATA; // Received character is in prefix, continue
currentLED = 0; // Set current LED to the first one
}
else
{
state = STATE_WAITING; // Crap, one of the received chars is NOT in the prefix
break; // Exit, to go back to waiting for the prefix
} // end if buffer
} // end for Counter
} // end if Serial
break;

state = STATE_WAITING; // Reset to waiting ...
currentLED = 0; // and go to LED one

break; // and exit ... and do it all over again
}
break;
} // switch(state)

} // loop

// Sets the color of all LEDs in the strand to 'color'
// If 'wait'>0 then it will show a swipe from start to end
void setAllLEDs(uint32_t color, int wait)
{
for ( int Counter=0; Counter < LEDCOUNT; Counter++ ) // For each LED
{
strip.setPixelColor( Counter, color ); // .. set the color

if( wait > 0 ) // if a wait time was set then
{
strip.show(); // Show the LED color
delay(wait); // and wait before we do the next LED
} // if wait

} // for Counter

strip.show(); // Show all LEDs
} // setAllLEDs

Wem die Bautrate wundert das habe ich einer Anleitung entnommen,

Code:

What about Raspberry Pi Arduino USB serial port speed? Use 500.000 !

You must set the same speed in Hyperion (Boblight) configuration and in your Arduino Adalight sketch! Usually standard speed are multiply of 9600 like 115200, 230400, 460800 but it will generate problems for your Raspberry/Arduino! In our tests 115200 work ok, but it could probably be slow (just multiply necessary bandwidth e.g. 300 LEDs, each 3 colors, 1 byte per color, 30 fps … So you will probably need higher speeds. But you boblightd or hyperion will loose connections. Faster Arduinos will work better (eg. Mega can work at 230400, Arduino Due even better), but after lots of hours lost it looks like 500000 is best option. Why? Because it is multiply of CPU frequency and there are no lost clocks.