Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/pgmspace.h> //Needed to store stuff in Flash using PROGMEM
- #include <EEPROM.h> //Needed to store variables in memory to persist after power off.
- #include <FastLED.h> //Fastled library to control the LEDs
- #define MAX_BRIGHT 40
- #define LED_PIN 3
- #define LED_TYPE WS2812B
- #define COLOR_ORDER GRB
- #define NUM_LEDS 105
- #define NUM_LEDS_R1_MAX 35
- #define NUM_LEDS_R2_MAX 70
- #define NUM_LEDS_R3_MAX 105
- // Define the array of leds
- CRGB leds[NUM_LEDS];
- /* - - Stored Text - - */
- int thots_r1[] = {18,17,16,14,12,10,9,8,6,5,4,1,0};
- int thots_r2[] = {36,40,43,45,47,48,49,52};
- int thots_r3[] = {87,84,82,80,79,78,75,72,71};
- int thot_len_r1 = sizeof(thots_r1) / sizeof(thots_r1[0]);
- int thot_len_r2 = sizeof(thots_r2) / sizeof(thots_r2[0]);
- int thot_len_r3 = sizeof(thots_r3) / sizeof(thots_r3[0]);
- int sym_and[3][3] =
- {
- {0,1,0},
- {1,1,1},
- {0,1,0},
- };
- int prayers[] =
- {
- 1,1,0,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,1,1,0,0,1,0,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- };
- int prayers_r1[35]= {1,1,0,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- int prayers_r2[35]= {0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- int prayers_r3[35]= {0,1,1,0,0,1,0,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- void setup() {
- // put your setup code here, to run once:
- //Serial.begin(115200);
- delay(1500); //Startup power delay. 1.5 seconds.
- FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
- FastLED.setMaxPowerInVoltsAndMilliamps(5,800);
- //attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), changeEffect, CHANGE); // interupt for button press.
- FastLED.setBrightness(MAX_BRIGHT);
- fill_solid(leds, NUM_LEDS, CRGB::Black);
- FastLED.show();
- }
- void loop() {
- RunningLights();
- //text_scroll();
- }
- void text_scroll() {
- for( int j=0; j < 10; j++ ) //Do 4 cycles of chasing lights.
- {
- for(int q=0; q < 19; q++) //Size of the moving bars
- {
- for(int i=-16; i < NUM_LEDS_R1_MAX; i++) //Should be NUM_LEDS_
- {
- if(prayers_r1[] == 1){
- leds[i+q] = CRGB::Blue;
- }
- }
- // for(int i=0; i < 15; i=i+bar_size+1)
- // {
- // leds[i+q] = CRGB::Black;
- // }
- FastLED.show();
- FastLED.delay(WaveDelay);
- }
- }
- void RunningLights() {
- int x = 0;
- //FastLED.clear();
- for(int i = -16; i < NUM_LEDS_R1_MAX; i++) {
- if(prayers_r1[x] == 1 && i >= 1 )
- {
- leds[i] = CRGB::Blue;
- x++;
- }
- //x++;
- }
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement