Last active
February 27, 2024 10:45
-
-
Save chemdoc77/52ded62fc801247cc648b1eb84f9d2ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//New Product Test Sketch by Chemdoc77 | |
//used to test new RGB LED strips and Matrix that I purchase. | |
// 6/22/19 - updated to allow more than 255 LEDS. | |
#include <FastLED.h> | |
#define DATA_PIN 6 | |
#define LED_TYPE NEOPIXEL | |
#define NUM_LEDS 8 | |
CRGB leds[NUM_LEDS]; | |
int brightness = 20; | |
void setup() { | |
delay(2000); | |
FastLED.addLeds<LED_TYPE, DATA_PIN>(leds, NUM_LEDS); | |
FastLED.setDither(false); | |
FastLED.setCorrection(TypicalLEDStrip); | |
FastLED.setBrightness(brightness); | |
FastLED.setMaxPowerInVoltsAndMilliamps(5, 400); | |
set_max_power_indicator_LED(13); | |
fill_solid(leds, NUM_LEDS, CRGB::Black); | |
FastLED.show(); | |
} | |
void loop() { | |
fill_solid( leds, NUM_LEDS, CRGB::Red); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Black); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Blue); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Black); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Green); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Black); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Yellow); | |
FastLED.delay(500); | |
fill_solid( leds, NUM_LEDS, CRGB::Black); | |
FastLED.delay(500); | |
cd77_colorwipe_dot(CRGB::Red, 0, NUM_LEDS, 40); | |
cd77_colorwipe_dot(CRGB::Blue, 0, NUM_LEDS, 40); | |
cd77_colorwipe_dot(CRGB::Green, 0, NUM_LEDS, 40); | |
} | |
//==================== Functions =============================== | |
void cd77_colorwipe(CRGB color, uint16_t to, uint16_t wait) { | |
for (uint16_t i = 0; i <to; i++) { | |
leds[i] = color; | |
FastLED.delay(500); | |
} | |
} | |
void cd77_colorwipe_dot(CRGB color,uint16_t from, uint16_t to, uint16_t wait) { | |
for (uint16_t i = from; i <to; i++) { | |
leds[i] = color; | |
FastLED.delay(wait); | |
leds[i] = CRGB::Black; | |
FastLED.show(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment