mirror of https://github.com/ArduPilot/ardupilot
AP_SerialLED: add support for NeoPixelRGB via set_num_neopixel_rgb()
This commit is contained in:
parent
9ff3d21c20
commit
c91ca2d87a
|
@ -36,6 +36,15 @@ bool AP_SerialLED::set_num_neopixel(uint8_t chan, uint8_t num_leds)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set number of NeoPixels per pin in RGB mode
|
||||||
|
bool AP_SerialLED::set_num_neopixel_rgb(uint8_t chan, uint8_t num_leds)
|
||||||
|
{
|
||||||
|
if (chan >= 1 && chan <= 16 && num_leds <= AP_SERIALLED_MAX_LEDS) {
|
||||||
|
return hal.rcout->set_serial_led_num_LEDs(chan-1, num_leds, AP_HAL::RCOutput::MODE_NEOPIXELRGB);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// set number of ProfiLEDs per pin
|
// set number of ProfiLEDs per pin
|
||||||
bool AP_SerialLED::set_num_profiled(uint8_t chan, uint8_t num_leds)
|
bool AP_SerialLED::set_num_profiled(uint8_t chan, uint8_t num_leds)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AP_HAL/AP_HAL_Boards.h>
|
#include <AP_HAL/AP_HAL_Boards.h>
|
||||||
|
#include <AP_HAL/RCOutput.h>
|
||||||
|
|
||||||
#include "AP_SerialLED_config.h"
|
#include "AP_SerialLED_config.h"
|
||||||
|
|
||||||
|
@ -34,13 +35,15 @@ public:
|
||||||
// set number of LEDs per pin
|
// set number of LEDs per pin
|
||||||
bool set_num_neopixel(uint8_t chan, uint8_t num_leds);
|
bool set_num_neopixel(uint8_t chan, uint8_t num_leds);
|
||||||
bool set_num_profiled(uint8_t chan, uint8_t num_leds);
|
bool set_num_profiled(uint8_t chan, uint8_t num_leds);
|
||||||
|
// set number of LEDs per pin in RGB mode
|
||||||
|
bool set_num_neopixel_rgb(uint8_t chan, uint8_t num_leds);
|
||||||
|
|
||||||
// set RGB value on mask of LEDs. chan is PWM output, 1..16
|
// set RGB value on mask of LEDs. chan is PWM output, 1..16
|
||||||
void set_RGB_mask(uint8_t chan, uint32_t ledmask, uint8_t red, uint8_t green, uint8_t blue);
|
void set_RGB_mask(uint8_t chan, uint32_t ledmask, uint8_t red, uint8_t green, uint8_t blue);
|
||||||
|
|
||||||
// set RGB value on LED. LED -1 is all LEDs. LED 0 is first LED. chan is PWM output, 1..16
|
// set RGB value on LED. LED -1 is all LEDs. LED 0 is first LED. chan is PWM output, 1..16
|
||||||
void set_RGB(uint8_t chan, int8_t led, uint8_t red, uint8_t green, uint8_t blue);
|
void set_RGB(uint8_t chan, int8_t led, uint8_t red, uint8_t green, uint8_t blue);
|
||||||
|
|
||||||
// trigger sending of LED changes to LEDs
|
// trigger sending of LED changes to LEDs
|
||||||
void send(uint8_t chan);
|
void send(uint8_t chan);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue