ZitatAlles anzeigenOriginally posted by mamba0815
>>Is it possible to tuning it fine even if not directly supported?
Can you find out where is the difference between the Atmolight-Protocol and the one for the Arduino? I don't have the time right now to do it myself.
Mamba
I have searched some stuffs
i'm still testing with my win7 pc...
now i'm using a 64 leds strips with ws2801ic and a arduino uno rev 3 (atmel mega328p)
i have foung some atmolight protocol sketch for arduino from here:
https://bitbucket.org/RickDB/atmoduino/wiki/Home
the arduino code is:
#include <FastSPI_LED.h>
//Set the number of leds in the strip.
#define NUM_LEDS 64
// Sometimes chipsets wire in a backwards sort of way
struct CRGB {
unsigned char b;
unsigned char r;
unsigned char g;
};
// struct CRGB { unsigned char r; unsigned char g; unsigned char b; };
struct CRGB *leds;
#define PIN 4
void setup(){
Serial.begin(115200);
FastSPI_LED.setLeds(NUM_LEDS);
//Change this to match your led strip
FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2801);
//Change datarate to match your led strip as well
FastSPI_LED.setDataRate(1);
//If non-default SPI pins have been used change this.
FastSPI_LED.setPin(PIN);
FastSPI_LED.init();
FastSPI_LED.start();
leds = (struct CRGB*)FastSPI_LED.getRGBData();
clearLeds();
}
int readByte(){
while(Serial.available()==0){
FastSPI_LED.stop();
}
FastSPI_LED.start();
return Serial.read();
}
void clearLeds(){
for(int tmpChannel=0; tmpChannel<NUM_LEDS; tmpChannel++){
leds[tmpChannel].r = 0;
leds[tmpChannel].b = 0;
leds[tmpChannel].g = 0;
};
FastSPI_LED.show();
}
void loop(){
if(readByte() == 0xFF){
if(readByte() == 0x00){
if(readByte() == 0x00){
int channels = readByte();
for(int channel=0; channel<channels; channel++){
leds[channel].r = readByte();
leds[channel].b = readByte();
leds[channel].g = readByte();
}
FastSPI_LED.show();
}
}
}
else
{
//clearLeds();
//FastSPI_LED.stop();
}
}
Alles anzeigen
It uses Fast_spi library so it should compatible with several types of leds:
http://code.google.com/p/fastspi/
with this code i'm using a modded atmowin from same developer to drive more than 5 leds/15 channels up to 256 channels :
https://bitbucket.org/RickDB/atmowin-atmoduino-mod/wiki/Home
it works good...it's modded with adding a new device "Atmoduino" wich we can select the number of custom leds and com port.
the protocol should be the same used with atmolight
http://www.vdr-wiki.de/wiki/in…lugin#Serielles_Protokoll
serial speed is at 115200
and leds from 15 to custom (<256 channels).
Hope this helps.