//Достаточно 50 вместо 100
#include <FastLED.h>
#define LED_PIN 2
#define NUM_LEDS 256
CRGB leds[NUM_LEDS];
void setup() { FastLED.setBrightness(255); //итенсив!
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
/* FastLED.setMaxPowerInVoltsAndMilliamps(5,2500); */ } //!!
void loop() {
for (int i = 0; i <= NUM_LEDS; i++) {
leds[i] = CRGB(0, 0, 255); //Blue
FastLED.show(); delay(100);
}
//for (int i = NUM_LEDS; i >= 0; i--) {
// leds[i] = CRGB(100, 0, 0); //Red
// FastLED.show(); delay(1);
// }
}
/*# Питон. Движение Led-тройки. Для Esp32. Был pin 23
import neopixel
import time
import machine
import math
pin = 2 # GPIO pin for NeoPixel
num_leds = 256
matrix_width = 16
matrix_height = 16
np = neopixel.NeoPixel(machine.Pin(pin), num_leds) # Initialize NeoPixel
runs=[0,0,0]
for num in range(num_leds):
print(runs)
np[runs[0]]=((0,0,0))
np[runs[1]]=((0,0,0))
np[runs[2]]=((0,0,0))
np.write()
runs[0]=min(0+num,0+num%num_leds)
np[runs[0]]=((0,255,0))
runs[1]=min(1+num,1+num%num_leds)
np[runs[1]]=((0,255,0))
runs[2]=min(2+num,2+num%num_leds)
np[runs[2]]=((0,255,0))
np.write()
time.sleep(0.1)
np.fill((0, 0, 0)) # Clear the NeoPixel matrix
np.write() */
FPS: 0
Power: 0.00W
Power: 0.00W