Hi,
hänge derzeit etwas bei meinem Project eine LED-Matrix aus 80 WS2801 Pixel Module in einem Chouchtisch.
Hoffe ihr könnt mir dabei weierhelfen.
Nach längerem einlesen und suche nach verschiedensten Modulen wäre ich zur folgende Lösung gekommen:
Arduino Uno Rev3(http://www.arduino.cc/en/Main/arduinoBoardUno)
- Arduino Wifi Shield(http://arduino.cc/en/Main/ArduinoWiFiShield)
- 80 WS2801 Pixel Module(http://www.aliexpress.com/store/product/20pcs-string-waterproof-led-pixel-module-4pcs-SMD-RGB-5050-1pcs-WS2801-256-gray-level-DC12V/701799_519156534.html)
Alternative gäbs noch:
ChipKit Uno32(https://www.microchipdirect.com/ProductSearch.aspx?Keywords=TDGL002)
- ChipKit Wifi Shield(https://www.microchipdirect.com/ProductSearch.aspx?Keywords=TDGL016)
- 80 WS2801 Pixel Module(http://www.aliexpress.com/store/product/20pcs-string-waterproof-led-pixel-module-4pcs-SMD-RGB-5050-1pcs-WS2801-256-gray-level-DC12V/701799_519156534.html)
Leider gibts noch recht wenig Infos über eine Ansteuerung solcher Pixel Module mit dem ChipKit Board, preislich wäre das Wifi Shield billiger.
Würde also eher zu der Arduino Variante tendieren.
Laut der Info Seite zum Arduino Wifi Shield werden die eingehenden Daten über SPI an den Arduino weitergegeben, den benötige ich jedoch für den Anschluss der Pixel-Module oder? Können mehrere SPI Verbindungen gleichzeitig laufen?
Bei der Software hab ich an Glediator gedacht, ich müsste nur in der Firmware die W-Lan Verbindung einbauen oder?
http://www.solderlab.de/index.php/downloads/file/24-frimwareglediatorws2801v2
//Change this to YOUR matrix size!!
#define Num_Pixels 16
#define CMD_NEW_DATA 1
int SDI = 13;
int CKI = 12;
unsigned char display_buffer[Num_Pixels * 3];
static unsigned char *ptr;
static unsigned int pos = 0;
volatile unsigned char go = 0;
void setup()
{
pinMode(SDI, OUTPUT);
pinMode(CKI, OUTPUT);
//UART Initialisation
UCSR0A |= (1<<U2X0);
UCSR0B |= (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0);
UCSR0C |= (1<<UCSZ01) | (1<<UCSZ00) ;
UBRR0H = 0;
UBRR0L = 3; //Baud Rate 0.5 MBit --> 0% Error at 16MHz :-)
ptr=display_buffer;
//Enable global interrupts
sei();
}
void loop()
{
if (go==1) {shift_out_data(); go=0;}
}
//############################################################################################################################################################
// UART-Interrupt-Prozedur (called every time one byte is compeltely received) #
//############################################################################################################################################################
ISR(USART_RX_vect)
{
unsigned char b;
b=UDR0;
if (b == CMD_NEW_DATA) {pos=0; ptr=display_buffer; return;}
if (pos == (Num_Pixels*3)) {} else {*ptr=b; ptr++; pos++;}
if (pos == ((Num_Pixels*3)-1)) {go=1;}
}
//############################################################################################################################################################
// Shift out Data #
//############################################################################################################################################################
void shift_out_data()
{
for (int i=0; i<Num_Pixels; i++)
{
byte r = display_buffer[i*3+0];
byte g = display_buffer[i*3+1];
byte b = display_buffer[i*3+2];
for (byte j=0; j<8; j++)
{
digitalWrite(CKI, LOW);
if (b & (byte)(1<<(7-j))) {digitalWrite(SDI, HIGH);} else {digitalWrite(SDI, LOW);}
digitalWrite(CKI, HIGH);
}
for (byte j=0; j<8; j++)
{
digitalWrite(CKI, LOW);
if (r & (1<<(7-j))) {digitalWrite(SDI, HIGH);} else {digitalWrite(SDI, LOW);}
digitalWrite(CKI, HIGH);
}
for (byte j=0; j<8; j++)
{
digitalWrite(CKI, LOW);
if (g & (1<<(7-j))) {digitalWrite(SDI, HIGH);} else {digitalWrite(SDI, LOW);}
digitalWrite(CKI, HIGH);
}
}
digitalWrite(CKI, LOW);
delayMicroseconds(800); //Latch Data
}
//############################################################################################################################################################
//############################################################################################################################################################
//############################################################################################################################################################
Hoff ihr könnt mir helfen.