Created
May 23, 2020 08:34
-
-
Save hputzek/9465e4ddabdc07866e0536040b5e9dfb to your computer and use it in GitHub Desktop.
Led Tester
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
/** | |
* TPM2 Example | |
* with the FastLED library | |
* | |
* Copyright (c) 2019 Stephan Ruloff | |
* https://github.com/rstephan/TPM2 | |
* | |
* GPL v2 only | |
*/ | |
#include <Arduino.h> | |
#include <FastLED.h> | |
#define PIN 5 | |
#define NUM_LEDS 40 | |
CRGBArray<NUM_LEDS> leds; | |
void setup() { FastLED.addLeds<NEOPIXEL,PIN>(leds, NUM_LEDS); } | |
void loop(){ | |
static uint8_t hue; | |
for(int i = 0; i < NUM_LEDS/2; i++) { | |
// fade everything out | |
leds.fadeToBlackBy(20); | |
// let's set an led value | |
leds[i] = CHSV(hue++,255,80); | |
// now, let's first 20 leds to the top 20 leds, | |
leds(NUM_LEDS/2,NUM_LEDS-1) = leds(NUM_LEDS/2 - 1 ,0); | |
FastLED.delay(99); | |
} | |
} |
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
;PlatformIO Project Configuration File | |
; | |
; Build options: build flags, source filter | |
; Upload options: custom upload port, speed and extra flags | |
; Library options: dependencies, extra library storages | |
; Advanced options: extra scripting | |
; | |
; Please visit documentation for the other options and examples | |
; https://docs.platformio.org/page/projectconf.html | |
[env:esp12e] | |
platform = espressif8266 | |
board = esp12e | |
framework = arduino | |
lib_deps = | |
https://github.com/FastLED/FastLED.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment