Page 1 of 1
Forum

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...
 
Share:
Notifications
Clear all

[Solved] a question about the sketch

2 Posts
2 Users
0 Likes
1,685 Views
(@twingi)
New Member
Joined: 4 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 4 years ago by twingi

   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2677
 

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) )
  {
    leds[LedNo]=color;
  }
  else
  {
    leds[LedNo]=CRGB::Black;
  }
}

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.

 


   
ReplyQuote
Share: