thanks, the analog leds will probably end up being swapped out for digital strips as well once i get this worked out. but they may stay analog as well. havent really settled on that as yet, focusing on one bit at a time.
also for the use i have they are just 2 leds within a small tail but this is a slightly bigger project but increasing the led size compensates for that.
So you need to show us how you propose to hook it up, and what software you propose to use so we can check this. This involves you drawing a circuit diagram of some sorts. Hand drawn is fine, no need to use any software to produce it. Just post a photograph of it.
exit status 1
expression cannot be used as a function
with this line highlighted
BRIGHTNESS (leds[0], random(120)+135);
so it would seem i would have to create brightness as a function. i have found this page, which does explain it pretty well, however i am having trouble understanding it and how to construct the function i require. would it be possible for someone to step in and help with this section? or should i not bother with that as it wouldnt work anyway?
here is what im using to test the code on, its a digispark board. cheap and quick and simple. the code will translate to an uno without a problem or modification (other than pin assignments) as im sure you all know.
ok so this makes the first led turn on however the flickering on it appears to be the same brightness. also the other 4 leds arent turning on. i get its only controlling the first pixel so how would i go about getting all 5 to light up with this current code? (will figure out the brightness next)
fills the strip together. making progress. im posting updates so as i ask questions but work it out solo (with googles help lol) you can see how its coming.
so, with the fill solid, how do i go about variying the brightness? this is the point im really stuck on and need your help to be fair.
im thinking maybe a HSV based code would be better for this. apparently set.brightness wasnt intended for repeated use in a code and more to be used in setup as a one time command.
Yes, set brightness affects all future uses of the set LEDs colours. Once a colour is in the buffer, set brightness has no effect.
So if you want to change the brightness of an individual LED, then set the brightness, then set the colour. You can't use fill_solid because that fills all the LEDs with the same brightness. You have to set the individual LED.
So set the brightness, set the colour of leds[0]. Then set the brightness and then set the colour of leds[1], repeat this for all leds index up to 4, which represents your 5 LEDs.
Of course this is a very clack handed way of going about things, and there are much better ways of doing this. But at the moment I don't think you understand how to set the RGB value of an individual LED.
they are all doing different things. albeit very similar things but still different, and with this i can increase the strip to 10 and use more of these for the blue as well, this will also allow me to set the blue to a lower brightness value as not to overpower the purple.
well i kind of hit a snag, the projects been assembled with the wires in place that was based on the assumption of 2 standard leds per flame. soooooo theres only 3 wires in each arm that has a flame on. that makes using these ws2812bs a little harder.
so i considered a solution to that issue in which i can use an uno with its 5 required pwm pins (out of the 6) and simply create arrays and one array on each pin.
so i gotta work on creating the arrays and pin assignments to that blah blah blah before i worry about a for statement.
reason being, i kind of want to get the code functional, then clean it up. i know, its backwards, and more time consuming. but thats just the way this has to go as got a deadline on this project and switching from standard leds to digital is a bit of a set back in itself.
reason i say im not sure it will function correctly is because i cannot work out how to tell the code the BLUE color is for the second pixel? or is that assumed by the code? also im back to trying to work out how to get the 5 strips to have different brightnesses for the 2 colors from each other.
so, can someone point me in the right direction for those 2 questionable points please?
hey mike, your last comment, the array code was taken from the array example.
// ArrayOfLedArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
// using multiple controllers. In this example, we're going to set up three NEOPIXEL strips on three
// different pins, each strip getting its own CRGB array to be played with, only this time they're going
// to be all parts of an array of arrays.
#include <FastLED.h>
#define NUM_STRIPS 3
#define NUM_LEDS_PER_STRIP 60
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
// For mirroring strips, all the "special" stuff happens just in setup. We
// just addLeds multiple times, once for each strip
void setup() {
// tell FastLED there's 60 NEOPIXEL leds on pin 2
FastLED.addLeds<NEOPIXEL, 2>(leds[0], NUM_LEDS_PER_STRIP);
// tell FastLED there's 60 NEOPIXEL leds on pin 3
FastLED.addLeds<NEOPIXEL, 3>(leds[1], NUM_LEDS_PER_STRIP);
// tell FastLED there's 60 NEOPIXEL leds on pin 4
FastLED.addLeds<NEOPIXEL, 4>(leds[2], NUM_LEDS_PER_STRIP);
}
void loop() {
// This outer loop will go over each strip, one at a time
for(int x = 0; x < NUM_STRIPS; x++) {
// This inner loop will go over each led in the current strip, one at a time
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
leds[x][i] = CRGB::Red;
FastLED.show();
leds[x][i] = CRGB::Black;
delay(100);
}
}
}