Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastSPI_LED.h>
- #include <SD.h>
- #include <Wire.h>
- //#include <Adafruit_GFX.h>
- //#include <Adafruit_SSD1306.h>
- int color[3];
- // *** LED stuff
- struct CRGB {
- unsigned char g;
- unsigned char r;
- unsigned char b;
- };
- #define NUM_LEDS 42 //42 in the middle I think?
- // pin that the WS2811 strip is attached to on the arduino
- #define PIN 4 // for D5... oh arduino...
- struct CRGB *leds;
- int idx_offset = 0; // ** included because I am lazy! OFFSET INDEX (BOTTOM LED TO ZERO WHEN LOOP IS TURNED/DOESN'T REALLY WORK)
- int hue=0;
- int ledNum=0;
- int upDown = 1;
- void setup()
- {
- // *** WS2811 setup
- FastSPI_LED.setLeds(NUM_LEDS);
- FastSPI_LED.setChipset(CFastSPI_LED::SPI_TM1809); // seriously amazes me this works
- FastSPI_LED.setPin(PIN);
- FastSPI_LED.setDataRate(7); //-IF LEDS FLICKER, PLAY WITH THIS (0-7)
- FastSPI_LED.init();
- FastSPI_LED.start();
- leds = (struct CRGB*)FastSPI_LED.getRGBData(); // I think this marries the leds struct to wtf ever fastSPI is doing. I suck at C.
- // *** AND GO!
- Serial.begin(56700);
- Serial.println("HELLO!!!");
- // begin staff bootup seq
- one_color_all(127,0,0); //RGB order. color test B
- delay(250);
- one_color_all(0,127,0); //RGB order. color test G
- delay(250);
- one_color_all(0,0,127); //RGB order. color test R
- delay(250);
- //one_color_all(255,255,255); // max power test (all on white)
- //delay(500);
- randomSeed(analogRead(A0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement