Skip to content

feature-request for setRGB(r,g,b); #23

@s-light

Description

@s-light
  • Arduino board: Adafruit ESP32-S3 Reverse TFT Feather

  • Arduino IDE version

Version: 2.2.1
Date: 2023-08-31T14:16:33.536Z
CLI Version: 0.34.0

Copyright © 2023 Arduino SA

simple featurerequest:
add some helper functions for faster / easier setting to all leds at once:

void setRGB(uint16_t idx, uint16_t r, uint16_t g, uint16_t b);
  void setRGB(uint16_t r = 0, uint16_t g = 0, uint16_t b = 0);
void Adafruit_TLC59711::setRGB(uint16_t idx, uint16_t r, uint16_t g, uint16_t b) {
  setLED(idx, r, g, b);
}
void Adafruit_TLC59711::setRGB(uint16_t r, uint16_t g, uint16_t b) {
  for (uint16_t i=0, n=4*numTlc; i<n; i++)
    setRGB(i, r, g, b);
}

this way you could easily set leds - all with the same function name:

// all LEDs at once to off
tlc.setRGB();

// all LEDs at once to green
tlc.setRGB(0, 2000, 0);

// classic just on led
tlc.setRGB(0, 42, 420);

would a pr with these additions be accepted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions