Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SPI.h"
- #include "Adafruit_WS2801.h"
- int dataPin = 2; // Pin danych
- int clockPin = 3; // Pin zegara
- Adafruit_WS2801 strip = Adafruit_WS2801(1, dataPin, clockPin);
- int i=0;
- int j = 0;
- int k = 0;
- int n = 0;
- void setup() {
- Serial.begin(9600);
- strip.begin();
- strip.show(); // Wywołanie od drazu metody show() spowoduje wyłączenie wszystkich diod
- n = 20;
- }
- void loop() {
- for (i = 0; i < n; i++){
- for (j = 0; j < n; j++) {
- for (k = 0; k < n; k++) {
- strip.setPixelColor(0, i, j, k);
- Serial.print(i);
- Serial.print(" ");
- Serial.print(j);
- Serial.print(" ");
- Serial.print(k);
- Serial.println(" ");
- strip.show();
- delay(200);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement