II just got my self a Circuit playground (Classic) and got hold of a sketch for it that i want to use and all works fine but i want to be able to lower the intense on the led light as it is to intense for what i want it for.
So as i am rely new to all this i rely need help on this.
As i will have it in a miniature fire pit like this one - Miniature Fire pit
The code i will be using is this one that i got here - Jack-o'-Lantern
And here is the code.
#include "Adafruit_CircuitPlayground.h"
void setup() {
CircuitPlayground.begin();
CircuitPlayground.setBrightness(255); // LEDs full blast!
}
uint8_t prev = 128; // Start brightness in middle
void loop() {
uint8_t lvl = random(64, 192); // End brightness at 128±64
split(prev, lvl, 32); // Start subdividing, ±32 at midpoint
prev = lvl; // Assign end brightness to next start
}
void split(uint8_t y1, uint8_t y2, uint8_t offset) {
if(offset) { // Split further into sub-segments w/midpoint at ±offset
uint8_t mid = (y1 + y2 + 1) / 2 + random(-offset, offset);
split(y1 , mid, offset / 2); // First segment (offset is halved)
split(mid, y2 , offset / 2); // Second segment (ditto)
} else { // No further subdivision - y1 determines LED brightness
uint32_t c = (((int)(pow((float)y1 / 255.0, 2.7) * 255.0 + 0.5) // Gamma
* 0x1004004) >> 8) & 0xFF3F03; // Expand to 32-bit RGB color
for(uint8_t i=0; i<10; i++) CircuitPlayground.strip.setPixelColor(i, c);
CircuitPlayground.strip.show();
delay(4);
}
}
So i hope some one can help me out on this.