Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define LEDPIN 8
- #define NUMOFLEDS 32*8
- #define width 32
- #define height 8
- CRGB leds[NUMOFLEDS];
- void setup() {
- FastLED.addLeds<WS2812, LEDPIN, GRB>(leds, NUMOFLEDS);
- }
- void LED(int hg, int wt, int r , int g, int b){ //THIS ALLOW YOU TO USE CARTESIAN COORDINATES
- if ( hg % 2 == 0){
- leds[wt + hg * 32] = CRGB(r,g,b);
- FastLED.show();
- } else {
- leds[(31 - wt) + hg * 32] = CRGB(r,g,b);
- FastLED.show();
- }
- }
- int led = 0;
- int i,j;
- void loop() {
- FastLED.clear();
- for ( i = 0; i < width ; i ++){
- for( j = 0; j < height; j++){
- LED(j,i,16,16,16);
- //delay(1);
- }
- //delay(1);
- }
- //delay(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement