mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 13:16:45 +00:00
set BACKLIGHT_CHANNEL to 0
This commit is contained in:
parent
a59ba3887c
commit
33f85b8975
@ -31,7 +31,7 @@
|
|||||||
#include "png_decoder.h"
|
#include "png_decoder.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BACKLIGHT_CHANNEL 15 // pwm channel 0-15
|
#define BACKLIGHT_CHANNEL 0 // pwm channel 0-15
|
||||||
|
|
||||||
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
||||||
File pFileOut;
|
File pFileOut;
|
||||||
@ -310,7 +310,7 @@ void guiSetup()
|
|||||||
Log.verbose(TAG_GUI, F("Backlight : Pin %d"), guiBacklightPin);
|
Log.verbose(TAG_GUI, F("Backlight : Pin %d"), guiBacklightPin);
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
ledcSetup(BACKLIGHT_CHANNEL, 20000, 10);
|
ledcSetup(BACKLIGHT_CHANNEL, 20000, 12);
|
||||||
ledcAttachPin(guiBacklightPin, BACKLIGHT_CHANNEL);
|
ledcAttachPin(guiBacklightPin, BACKLIGHT_CHANNEL);
|
||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
pinMode(guiBacklightPin, OUTPUT);
|
pinMode(guiBacklightPin, OUTPUT);
|
||||||
@ -448,7 +448,7 @@ void guiSetBacklight(bool lighton)
|
|||||||
if(guiBacklightPin >= 0) {
|
if(guiBacklightPin >= 0) {
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
ledcWrite(BACKLIGHT_CHANNEL, lighton ? map(guiDimLevel, 0, 100, 0, 1023) : 0); // ledChannel and value
|
ledcWrite(BACKLIGHT_CHANNEL, lighton ? map(guiDimLevel, 0, 100, 0, 4095) : 0); // ledChannel and value
|
||||||
#else
|
#else
|
||||||
analogWrite(guiBacklightPin, lighton ? map(guiDimLevel, 0, 100, 0, 1023) : 0);
|
analogWrite(guiBacklightPin, lighton ? map(guiDimLevel, 0, 100, 0, 1023) : 0);
|
||||||
#endif
|
#endif
|
||||||
@ -466,7 +466,7 @@ void guiSetDim(int8_t level)
|
|||||||
|
|
||||||
if(guiBacklightIsOn) { // The backlight is ON
|
if(guiBacklightIsOn) { // The backlight is ON
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
ledcWrite(BACKLIGHT_CHANNEL, map(guiDimLevel, 0, 100, 0, 1023)); // ledChannel and value
|
ledcWrite(BACKLIGHT_CHANNEL, map(guiDimLevel, 0, 100, 0, 4095)); // ledChannel and value
|
||||||
#else
|
#else
|
||||||
analogWrite(guiBacklightPin, map(guiDimLevel, 0, 100, 0, 1023));
|
analogWrite(guiBacklightPin, map(guiDimLevel, 0, 100, 0, 1023));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user