Compare commits
2 Commits
master
...
rainbow_cy
Author | SHA1 | Date | |
---|---|---|---|
7ab5be7997 | |||
1b07c426d1 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.pio
|
.pio
|
||||||
|
.vscode
|
||||||
|
@ -17,4 +17,6 @@ board_build.mcu = esp8266
|
|||||||
; change MCU frequency
|
; change MCU frequency
|
||||||
board_build.f_cpu = 80000000L
|
board_build.f_cpu = 80000000L
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
|
lib_deps =
|
||||||
|
WS2812FX
|
||||||
|
JustWifi
|
||||||
|
12
src/main.cpp
12
src/main.cpp
@ -1,4 +1,5 @@
|
|||||||
#include <WS2812FX.h>
|
#include <WS2812FX.h>
|
||||||
|
#include <ESP8266WiFi.h>
|
||||||
|
|
||||||
#define LED_COUNT 60
|
#define LED_COUNT 60
|
||||||
#define LED_PIN 12
|
#define LED_PIN 12
|
||||||
@ -19,13 +20,18 @@ unsigned long last_change = 0;
|
|||||||
unsigned long now = 0;
|
unsigned long now = 0;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
ws2812fx.init();
|
|
||||||
|
WiFi.mode(WIFI_OFF);
|
||||||
|
WiFi.forceSleepBegin();
|
||||||
|
delay(1);
|
||||||
|
|
||||||
|
ws2812fx.init();
|
||||||
|
|
||||||
// Set the LED’s overall brightness. 0=strip off, 255=strip at full intensity
|
// Set the LED’s overall brightness. 0=strip off, 255=strip at full intensity
|
||||||
ws2812fx.setBrightness(255);
|
ws2812fx.setBrightness(255);
|
||||||
|
|
||||||
// Set the animation speed. 10=very fast, 5000=very slow
|
// Set the animation speed. 10=very fast, 5000=very slow
|
||||||
ws2812fx.setSpeed(1000);
|
ws2812fx.setSpeed(5000);
|
||||||
|
|
||||||
// Set the color of the LEDs
|
// Set the color of the LEDs
|
||||||
ws2812fx.setColor(WHITE);
|
ws2812fx.setColor(WHITE);
|
||||||
@ -33,7 +39,7 @@ void setup() {
|
|||||||
// Select an animation effect/mode. 0=static color, 1=blink, etc. You
|
// Select an animation effect/mode. 0=static color, 1=blink, etc. You
|
||||||
// can specify a number here, or there some handy keywords defined in
|
// can specify a number here, or there some handy keywords defined in
|
||||||
// the WS2812FX.h file that are more descriptive and easier to remember.
|
// the WS2812FX.h file that are more descriptive and easier to remember.
|
||||||
ws2812fx.setMode(FX_MODE_TWINKLE_FADE);
|
ws2812fx.setMode(FX_MODE_RAINBOW_CYCLE);
|
||||||
|
|
||||||
// Start the animation
|
// Start the animation
|
||||||
ws2812fx.start();
|
ws2812fx.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user