Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FastLED.h"
- #define NUM_LEDS 63
- #define DATA_PIN 2
- #define CLOCK_PIN 3
- // Define the array of leds
- CRGB leds[NUM_LEDS];
- int leds_left[] = {42,44,43,47,46,45,51,50,49,48,56,55,54,53,52,62,61,60,59,58,57}; //led_side[0]
- int leds_right[] = {41,39,40,36,37,38,32,33,34,35,27,28,29,30,31,21,22,23,24,25,26}; //led_side[1]
- int leds_back[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}; //led_side[2]
- int led_side[][21] = {{42,44,43,47,46,45,51,50,49,48,56,55,54,53,52,62,61,60,59,58,57}, //left
- {41,39,40,36,37,38,32,33,34,35,27,28,29,30,31,21,22,23,24,25,26}, //right
- {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}}; //back
- int ledLetters[][21] = {
- {1,2,5,3,6,7,8,9,14,10}, // 0 = A
- {1,2,5,3,6,7,8,13,11,17,18}, // 1 = B
- {1,2,5,3,6,13,11,17,18}, // 2 = C
- {1,2,5,3,7,9,13,11,17,18}, // 3 = D
- {1,2,5,6,7,8,13,17,18}, // 4 = E
- {1,2,5,6,7,8,13,17}, // 5 = F
- {1,2,5,6,8,9,13,11,17,18}, // 6 = G
- {1,5,3,6,7,8,9,13,11,18}, // 7 = H
- {1,2,4,7,8,12,17,18}, // 8 = I
- {2,3,9,13,11,17,18}, // 9 = J
- {1,5,3,7,8,13,11,17,19}, // 10 = K
- {1,5,7,13,17,18,19}, // 11 = L
- {5,3,6,7,8,9,14,12,10,15,20}, // 12 = M
- {5,6,7,9,14,12,11,15,18}, // 13 = N
- {1,2,5,3,6,9,13,11,17,18}, // 14 = O
- {1,2,5,3,7,8,13,16}, // 15 = P
- {1,2,5,3,6,9,13,11,17,18,19}, // 16 = Q
- {1,2,5,3,6,7,8,14,11,15,19}, // 17 = R
- {2,1,5,7,8,11,18,17}, // 18 = S
- {5,4,3,7,12,17}, // 19 = T
- {5,3,6,9,13,11,17,18}, // 20 = U
- {5,7,9,12,11,18}, // 21 = V
- {5,3,6,9,13,12,11,17,18}, // 22 = W
- {5,3,7,8,12,11,17,19}, // 23 = X
- {5,3,7,8,12,17}, // 24 = Y
- {5,4,3,8,12,17,18,19}, // 25 = Z
- {}, // 26 = LEERZEICHEN
- {1,2,5,3,6,9,13,11,17,18}, // 27 = 0
- {1,2,4,7,8,12,17,18}, // 28 = 1
- {1,2,5,3,8,12,17,18,19}, // 29 = 2
- {1,2,3,7,8,11,17,18}, // 30 = 3
- {0,1,5,6,7,8,9,12,17}, // 31 = 4
- {1,2,5,6,7,8,11,17,18}, // 32 = 5
- {1,2,5,6,7,8,13,11,17,18}, // 33 = 6
- {5,4,3,8,12,17}, // 34 = 7
- {1,2,5,3,7,8,13,11,17,18}, // 35 = 8
- {1,2,5,3,6,7,8,9,11,17,18}, // 36 = 9
- };
- // Hilfsarray fuer die Darstellung von Buchstaben und Ziffern
- int letterLength[] = {
- 10, // A
- 11, // B
- 9, // C
- 10, // D
- 9, // E
- 8, // F
- 10, // G
- 10, // H
- 8, // I
- 7, // J
- 9, // K
- 7, // L
- 11, // M
- 9, // N
- 10, // O
- 8, // P
- 11, // Q
- 11, // R
- 8, // S
- 6, // T
- 8, // U
- 6, // V
- 9, // W
- 8, // X
- 6, // Y
- 8, // Z
- 0, // LEERZEICHEN
- 10, // 0
- 8, // 1
- 9, // 2
- 8, // 3
- 10, // 4
- 9, // 5
- 10, // 6
- 6, // 7
- 10, // 8
- 11, // 9
- };
- void setup() {
- delay(1000);
- FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
- }
- void loop() {
- int hue = random8();
- for(int symbol=0;symbol<37;symbol++){ //gehe alle Symbole durch
- for(int i = 0;i<NUM_LEDS;i++) leds[i] = CRGB::Black;
- for(int side = 0;side<3;side++){ //jede Seite
- for(int j = 0;j<letterLength[symbol];j++){
- leds[led_side[side][ledLetters[symbol][j]]] = CHSV(hue, 255, 255);
- }
- }
- FastLED.show();
- delay(2000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement