Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <stdint.h>
#include <Arduino.h>
#include <FastLED.h>
#define DATA_PIN_LED 27
const int pushButton = 39;
static CRGB leds[25];
void setup(void)
{
Serial.begin(115200);
FastLED.addLeds < WS2812B, DATA_PIN_LED, GRB > (leds, 25);
FastLED.setBrightness(20);
}
void loop(void)
{
static int cubestartpoint[] = {0,0,0};
static int state = 0;
static int Numbersprite = 0;
static int tenssprite = 2;
static int hunderdssprite = 1;
static int thousendssprite = 1;
static int place = 0;
static int cube[10][25]={{1,1,1,1,1,
1,0,0,1,1,
1,0,1,0,1,
1,1,0,0,1,
1,1,1,1,1},
{0,1,0,0,0,
1,1,0,0,0,
0,1,0,0,0,
0,1,0,0,0,
1,1,1,0,0},
{1,1,1,1,0,
0,0,0,0,1,
0,1,1,1,0,
1,0,0,0,0,
1,1,1,1,1},
{1,1,1,1,1,
0,0,0,0,1,
1,1,1,1,0,
0,0,0,0,1,
1,1,1,1,1},
{1,0,0,0,0,
1,0,0,0,0,
1,0,1,0,0,
1,1,1,1,1,
0,0,1,0,0},
{1,1,1,1,1,
1,0,0,0,0,
1,1,1,1,0,
0,0,0,0,1,
1,1,1,1,0},
{1,1,1,1,1,
1,0,0,0,0,
1,1,1,1,1,
1,0,0,0,1,
1,1,1,1,1},
{1,1,1,1,1,
0,0,0,0,1,
0,0,0,1,0,
0,0,1,0,0,
0,0,1,0,0},
{1,1,1,1,1,
1,0,0,0,1,
1,1,1,1,1,
1,0,0,0,1,
1,1,1,1,1},
{1,1,1,1,1,
1,0,0,0,1,
1,1,1,1,1,
0,0,0,0,1,
1,1,1,1,1},
};
if(Numbersprite){
if(place < 25){
int state = { cube[Numbersprite][place]};
if(state){
leds[place] = CRGB::White;
};
if(!state){
leds[place] = CRGB::Black;
};
place++;
};
if(place > 24){
Numbersprite--;
place = 0;
delay(1000);
FastLED.show();
};
};
if(!Numbersprite and tenssprite){
if(place < 25){
int state = { cube[tenssprite][place]};
if(state){
leds[place] = CRGB::Red;
};
if(!state){
leds[place] = CRGB::Black;
};
place++;
};
if(place > 24){
tenssprite--;
place = 0;
Numbersprite = 9;
delay(1500);
FastLED.show();
};
};
if(!Numbersprite and !tenssprite){
if(place < 25){
leds[place] = CRGB::Green;
place++;
};
if(place > 24){
tenssprite=2;
place = 0;
Numbersprite = 0;
FastLED.show();
delay(10000);
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.