mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-14 12:02:38 +08:00
AP_SerialLED: allow more than 32 LEDs
This commit is contained in:
1 parent
fe86d8bb0c
commit
5ad4ceef71
2 files changed
+8
-5
No files matched your search
@@ -30,17 +30,17 @@ AP_SerialLED::AP_SerialLED()
|
||||
// set number of LEDs per pin
|
||||
bool AP_SerialLED::set_num_LEDs(uint8_t chan, uint8_t num_leds)
|
||||
{
|
||||
if (chan >= 1 && chan <= 16 && num_leds <= 32) {
|
||||
if (chan >= 1 && chan <= 16 && num_leds <= 64) {
|
||||
return hal.rcout->set_neopixel_num_LEDs(chan-1, num_leds);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// set RGB value on mask of LEDs. chan is PWM output, 1..16
|
||||
void AP_SerialLED::set_RGB(uint8_t chan, uint32_t ledmask, uint8_t red, uint8_t green, uint8_t blue)
|
||||
// set RGB value on LED number. LED number -1 is all LEDs. First LED is 0. chan is PWM output, 1..16
|
||||
void AP_SerialLED::set_RGB(uint8_t chan, int8_t led, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
if (chan >= 1 && chan <= 16) {
|
||||
hal.rcout->set_neopixel_rgb_data(chan-1, ledmask, red, green, blue);
|
||||
hal.rcout->set_neopixel_rgb_data(chan-1, led, red, green, blue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user