Page 1 of 1

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!

a question about th...
Clear all

a question about the sketch

2 Posts
2 Users
New Member
Joined: 3 years ago
Posts: 1
Topic starter  
is there a way to define certain leds in a sketch

all leds 56
but led 10 and 11 should not light up

how can i define it
This topic was modified 3 years ago by twingi

Famed Member Admin
Joined: 10 years ago
Posts: 2507

Hi Twingi,

this all depends a little on your sketch.

There is no easy "define" for this, but what you could do is define your own function to set a pixel.

For example, say you're using FastLED, where you can set a pixel with:

leds[lednumber] = color;

Now you could create your own function, something like this:

void setLED(int LedNo, CRGB color)
if( (LedNo<>10) && (LedNo<>11) )

This will set the LED color only if it is not #10 or #11.
If it is #10 or #11, it will set it to black (off).

Setting a LED color, so wherever you used to call "leds[lednumber]=color", you now do this:

setLED(lednumber, color);

Hope this helps.



Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).