Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------------------
- //2015 sprocket2cog CC.
- // 8x8 matrix (non serpentine) "corner pulse sketch"
- //----------------------------------------------
- #include "FastLED.h"
- #define DATA_PIN 6
- #define CHIPSET WS2812B
- #define COLOR_ORDER GRB
- #define NUM_LEDS 64
- #define BRIGHTNESS 255
- CRGB leds[NUM_LEDS];
- int x=0;
- void setup() {
- FastLED.addLeds<CHIPSET, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
- LEDS.setBrightness(BRIGHTNESS);
- }
- void loop() {
- drawPixels();
- FastLED.show();
- x=x+1;
- for (int i = 0 ; i < NUM_LEDS; i++) {
- leds[i] = CRGB::Black;
- };
- FastLED.show();
- }
- void drawPixels(){
- leds[sin8(x)/32] = CHSV(cos8(x),200,200);
- leds[(sin8(7-x)/32)*8] = CHSV(cos8(x),200,200);
- leds[sin8(7-x)/32] = CHSV(sin8(x),200,200);
- leds[(sin8(x)/32)*8] = CHSV(cos8(x),200,200);
- leds[(sin8(x)/32)*8+7] = CHSV(sin8(x),200,200);
- leds[(sin8(x)/32)+56] = CHSV(cos8(x),200,200);
- leds[(sin8(7-x)/32)*8+7] = CHSV(sin8(x),200,200);
- leds[sin8(7-x)/32+56] = CHSV(sin8(x),200,200);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement