The other two connections are for data control, the Serial Programming Interface SPI. There should be one for the SCK (clock) which has to be connected to the clock pin for SPI, usually pin 13 on recent arduinos. Then you need to connect the data input to the pin for master - to - slave data (MOSI), usually pin 11.
But in the example i see PIN 4 used.
I have only 4 wire, what pin i need?
The other two connections are for data control, the Serial Programming Interface SPI. There should be one for the SCK (clock) which has to be connected to the clock pin for SPI, usually pin 13 on recent arduinos. Then you need to connect the data input to the pin for master - to - slave data (MOSI), usually pin 11.
But in the example i see PIN 4 used.
I have only 4 wire, what pin i need?
The WS2801 does not use that, you can ignore it. You can also comment the .setPin() line further down because that too isn't needed.
Naruto128:
that difference, if I connect to other digital pins on
ws2801?, is the speed?
i I have plugged sdcard to pins 11, 12, 13, 10. and ws2801 to pins 3, 4
If you are using FastSPI_LED, you must connect the strip on the SPI bus, same as your SD reader. Pins 3 and 4 are not SPI ports.
However, because an WS2801 doesn't have a select line, you will encounter problems when you try to address the SD reader with the string also attached. You need to separate the two and use additional hardware to do that. Search the forums, it's been discussed before.
On the other hand, you can use something other than FastSPI_LED to drive the WS2801 strip via bitbang mode, and you won't need the SPI bus for that. At that point, you can connect it anywhere you want and use whatever pins you want.
You can also try the preview release of FastSPI_LED2 which allows you to use whatever pin you want, as well as driving multiple strings on the same AVR.
Naruto128:
that difference, if I connect to other digital pins on
ws2801?, is the speed?
i I have plugged sdcard to pins 11, 12, 13, 10. and ws2801 to pins 3, 4
If you are using FastSPI_LED, you must connect the strip on the SPI bus, same as your SD reader. Pins 3 and 4 are not SPI ports.
However, because an WS2801 doesn't have a select line, you will encounter problems when you try to address the SD reader with the string also attached. You need to separate the two and use additional hardware to do that. Search the forums, it's been discussed before.
On the other hand, you can use something other than FastSPI_LED to drive the WS2801 strip via bitbang mode, and you won't need the SPI bus for that. At that point, you can connect it anywhere you want and use whatever pins you want.
You can also try the preview release of FastSPI_LED2 which allows you to use whatever pin you want, as well as driving multiple strings on the same AVR.
reference to connect the WS2801, in terms of speed, which is faster, the SPI port OR other digital ping?
to connect the WS2803, i use this code
const int ws2803_clockPin = 3;
const int ws2803_dataPin = 4;
#define nLEDs 54
uint8_t ledBar[nLEDs];
void setup() {
Serial.begin(9600);
pinMode(ws2803_clockPin, OUTPUT);
pinMode(ws2803_dataPin, OUTPUT);
// Initialize WS2803 - Clock needs to be low at least 600us to prepare itself.
digitalWrite(ws2803_clockPin, LOW);
delayMicroseconds(600);
// Initialize the ledBar array - all LEDs OFF.
for(int wsOut = 0; wsOut < nLEDs; wsOut++){
ledBar[wsOut] = 0x00;
}
loadWS2803();
}
void loop() {
for(int wsOut = 0; wsOut < nLEDs; wsOut++){
ledBar[wsOut] = 123;
}
loadWS2803();
}
void loadWS2803(){
for (int wsOut = 0; wsOut < nLEDs; wsOut++){
shiftOut(ws2803_dataPin, ws2803_clockPin, MSBFIRST, ledBar[wsOut]);
}
delayMicroseconds(600); // 600us needed to reset WS2803s
}
Naruto128:
reference to connect the WS2801, in terms of speed, which is faster, the SPI port OR other digital ping?
Bitbanging is always slower than native SPI. HOWEVER, how fast do you NEED it to be? You may find that even with bitbanging it's way faster than you need to send data out. This is where you need to do your own homework and TEST things.
contecavour:
But it's so difficult say the answer?
Ck wire to PIN ???
dI wire to pin ???
You already found the answer:
contecavour:
I read
The other two connections are for data control, the Serial Programming Interface SPI. There should be one for the SCK (clock) which has to be connected to the clock pin for SPI, usually pin 13 on recent arduinos. Then you need to connect the data input to the pin for master - to - slave data (MOSI), usually pin 11.
Naruto128:
that difference, if I connect to other digital pins on
ws2801?, is the speed?
i I have plugged sdcard to pins 11, 12, 13, 10. and ws2801 to pins 3, 4
If you are using FastSPI_LED, you must connect the strip on the SPI bus, same as your SD reader. Pins 3 and 4 are not SPI ports.
However, because an WS2801 doesn't have a select line, you will encounter problems when you try to address the SD reader with the string also attached. You need to separate the two and use additional hardware to do that. Search the forums, it's been discussed before.
On the other hand, you can use something other than FastSPI_LED to drive the WS2801 strip via bitbang mode, and you won't need the SPI bus for that. At that point, you can connect it anywhere you want and use whatever pins you want.
You can also try the preview release of FastSPI_LED2 which allows you to use whatever pin you want, as well as driving multiple strings on the same AVR.
can not find the hardware to connect the WS2801 and SD CARD.