Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define USE_OCTOWS2811
- #include <OctoWS2811.h>
- #include <FastLED.h>
- #define NUM_LEDS_PER_STRIP 128
- #define NUM_STRIPS 8
- CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
- // Pin layouts on the teensy 3:
- // OctoWS2811: 2,14,7,8,6,20,21,5
- void setup() {
- Serial.begin(115200);
- pinMode(13, OUTPUT);
- digitalWrite(13, LOW);
- LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);
- LEDS.setBrightness(75);
- }
- int serialGlediator() {
- while (!Serial.available()) {}
- return Serial.read();
- }
- void loop() {
- while (serialGlediator() != 1) {}
- digitalWrite(13, HIGH);
- for (int i=0; i < NUM_STRIPS; i++) {
- for(int j=0; j < NUM_LEDS_PER_STRIP; j++) {
- leds[(i*NUM_LEDS_PER_STRIP) + j].r = serialGlediator();
- leds[(i*NUM_LEDS_PER_STRIP) + j].g = serialGlediator();
- leds[(i*NUM_LEDS_PER_STRIP) + j].b = serialGlediator();
- }
- }
- LEDS.show();
- digitalWrite(13, LOW);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement