Do you know that? ...

fastled-random
gplus
(варешяф рйезот) #1

Do you know that?

add your hints and short “hacks” in comments ))

(варешяф рйезот) #2

FastLED provides these pre-conigured incandescent color profiles:
Candle, Tungsten40W, Tungsten100W, Halogen, CarbonArc,
HighNoonSun, DirectSunlight, OvercastSky, ClearBlueSky,
FastLED provides these pre-configured gaseous-light color profiles:
WarmFluorescent, StandardFluorescent, CoolWhiteFluorescent, FullSpectrumFluorescent, GrowLightFluorescent, BlackLightFluorescent, MercuryVapor, SodiumVapor, MetalHalide, HighPressureSodium,
FastLED also provides an “Uncorrected temperature” profile UncorrectedTemperature;

(варешяф рйезот) #3

Mark Kriegsman says about COS function:
I usually start with the range of numbers that I think I’m going to want (eg, 20-50),
and then set up a cos() oscillator to swing between those. In floating point math,
you’d say output = (cos(something) * 15) + 35;
and that would swing between 35-15 (20) and 35+15 (50).
Then I decide how fast I want it to swing that number, and adjust the parameter inside
the cos() to suit.

(варешяф рйезот) #4

FastLED Tips, Tricks and Traps By Andrew Tuline:
http://tuline.com/some-fastled-notes/

(Marc Miller) #5

[I’ll try again… Google marked and deleted my code snippet as spam.]

To make a specific group of pixels into a pixel set, or custom CRGB set you can do something like this:

uint8_t LED_lookupTable_length = 5; //number of pixels in set
uint8_t LED_lookupTable[] = { 1, 4, 5, 7, 9}; //specific pixels

Then to run through it, use a for loop and use the values in the table to target the corresponding LEDs:
for( uint8_t LED = 0; LED < LED_lookupTable_length; LED++) {
uint8_t pos = LED_lookupTable[LED];
leds[pos] = CRGB(255, 0, 0); //assign some color
}

You can also use sizeof to more automatically generate the size of the table.

Also, @fa25514ad7a4d6321c2d here’s a quick sketch to easily visualize all those built in color temps.

(варешяф рйезот) #6

@marmil one more example for leds, that not by serial order (same with you):

#define ARRAY_SIZE(A) ( sizeof(A) / sizeof((A)[0]) )
uint8_t NotByOrder[] = {2,6,10,14,18,21,24,27,30,32};
uint8_t subsetLength = ARRAY_SIZE(NotByOrder));
for (uint8_t i=0; i<subsetLength ; i++) {
leds[ NotByOrder[i] ] = CRGB::Red;
}
(I dont remember author, sorry)

(варешяф рйезот) #7

some interesting quick C algorithms (for advanced coders): Bit Twiddling Hacks
https://graphics.stanford.edu/~seander/bithacks.html

(Lawrence Clark) #8

Neopixels / ws2812 work perfectly happily with 3v boards such as nodemcu and teensy usually without level shifting … plus the built in WiFi , faster processor and greater storage that the nodemcu has over most Arduinos (and the fact that they’re about a quarter of the price) means they’re really handy as standalone boards ; just add this line BEFORE the include fastles instruction to stop the flickering
#define FASTLED_ALLOW_INTERRUPTS 0

It can also do Artnet too for glediator / jinx …

(варешяф рйезот) #9

Do not use this contruction:

If (millis() >= lastMillis + INTERVAL)

Use this:
If (millis() – lastMillis >= INTERVAL)
And you never get overloading of millis()!!!

More here(Russian): http://arduino.ru/forum/programmirovanie/velikoe-perepolnenie-millis