#include <FastLED.h>
#define NUM_LEDS 256
#define DATA_PIN 12
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
FastLED.setBrightness(150);
}
int Arduino [8][32]{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 111, 128, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0},
{96, 0, 0, 135, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 0, 0},
{96, 0, 0, 135, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 0, 0, 192, 0},
{96, 111, 128, 135, 0, 160, 178, 0, 192, 210, 96, 0, 111, 0, 135, 0, 160, 0, 178, 192, 210, 0, 96, 111, 128, 0, 0, 0, 0, 0, 192, 0},
{96, 0, 0, 135, 0, 160, 0, 0, 192, 0, 96, 0, 111, 0, 135, 0, 160, 0, 178, 0, 210, 0, 96, 0, 128, 0, 0, 135, 0, 0, 192, 0},
{96, 0, 0, 135, 0, 160, 0, 0, 192, 210, 96, 0, 111, 128, 135, 0, 160, 0, 178, 0, 210, 0, 96, 111, 128, 0, 0, 0, 0, 178, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0},
};
void loop() {
for (int j=0;j<32;j++)
for (int i=0;i<8;i++){
if (!(j&1)and Arduino[i][j]==0) leds[j*8+i]=CRGB(0,0,0);
if (!(j&1)and Arduino[i][j]!=0) leds[j*8+i]=CHSV(Arduino[i][j],255,255);
if (j&1 and Arduino[i][j]==0 ) leds[j*8+7-i]=CRGB(0,0,0);
if (j&1 and Arduino[i][j]!=0 ) leds[j*8+7-i]=CHSV(Arduino[i][j],255,255);
delay(20);
FastLED.show();
}
}
Comments
Please log in or sign up to comment.