Skip to content

Commit edd40db

Browse files
committed
modified LCD_BacklightRGB
1 parent 6c757ca commit edd40db

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

examples/HelloWorld/HelloWorld.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* One outer pin: Connect to GND.
2424
* Other outer pin: Connect to 5V.
2525
*
26-
* @author felixthecat8a
26+
* @author https://github.com/felixthecat8a
2727
*/
2828

2929
#include <LiquidCrystal.h>

examples/RGB_LED_Example/RGB_LED_Example.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* - Green Pin: PWM pin ~10
1313
* - Blue Pin: PWM pin ~9
1414
*
15-
* @author felixthecat8a
15+
* @author https://github.com/felixthecat8a
1616
*/
1717

1818
#include <LCD_BacklightRGB.h>

examples/SimpleExample/SimpleExample.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* One outer pin: Connect to GND.
2727
* Other outer pin: Connect to 5V.
2828
*
29-
* @author felixthecat8a
29+
* @author https://github.com/felixthecat8a
3030
*/
3131

3232
#include <LiquidCrystal.h>

src/LCD_BacklightRGB.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,8 @@ void LCD_BacklightRGB::setRGB(int red, int green, int blue, int brightness) {
3434
rgb.setRGB(red, green, blue, brightness);
3535
}
3636

37-
const uint8_t* LCD_BacklightRGB::getRGB() const {
38-
uint8_t color[3];
39-
memcpy(color, rgb.getRGB(), 3);
40-
return color;
41-
//return rgb.getRGB();
37+
void LCD_BacklightRGB::getRGB(uint8_t out[3]) const {
38+
memcpy(out, rgb.getRGB(), 3);
4239
}
4340

4441
void LCD_BacklightRGB::setHex(uint32_t hexColor) {

src/LCD_BacklightRGB.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ class LCD_BacklightRGB {
7777
void setRGB(int red, int green, int blue, int brightness);
7878

7979
/**
80-
* @brief Returns the current RGB values.
81-
* @return Pointer to an array of 3 uint8_t values {R, G, B}.
80+
* @brief Copies the current RGB values into the provided array.
81+
* @param out Array of 3 uint8_t values where the RGB values will be stored.
8282
*/
83-
const uint8_t* getRGB() const;
83+
void getRGB(uint8_t out[3]) const;
8484

8585
/**
8686
* @brief Sets the RGB color using a hexadecimal color value.

0 commit comments

Comments
 (0)