Brightness range 10-100

This commit is contained in:
Noah Axon 2023-09-26 17:43:08 -05:00
parent 1ec18b05ed
commit d4483f2bd1
1 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ void screen_dim_proc() {
if (digitalRead(M5_BUTTON_RST) == LOW || digitalRead(M5_BUTTON_HOME) == LOW) { if (digitalRead(M5_BUTTON_RST) == LOW || digitalRead(M5_BUTTON_HOME) == LOW) {
if (screen_dim_dimmed) { if (screen_dim_dimmed) {
screen_dim_dimmed = false; screen_dim_dimmed = false;
M5.Axp.ScreenBreath(255); M5.Axp.ScreenBreath(100);
} }
int newtime = M5.Rtc.Second + screen_dim_time + 2; // hacky but needs a couple extra seconds added int newtime = M5.Rtc.Second + screen_dim_time + 2; // hacky but needs a couple extra seconds added
@ -73,7 +73,7 @@ void screen_dim_proc() {
} }
if (screen_dim_dimmed == false) { if (screen_dim_dimmed == false) {
if (M5.Rtc.Second == screen_dim_current || (M5.Rtc.Second + 1) == screen_dim_current || (M5.Rtc.Second + 2) == screen_dim_current) { if (M5.Rtc.Second == screen_dim_current || (M5.Rtc.Second + 1) == screen_dim_current || (M5.Rtc.Second + 2) == screen_dim_current) {
M5.Axp.ScreenBreath(0); M5.Axp.ScreenBreath(10);
screen_dim_dimmed = true; screen_dim_dimmed = true;
} }
} }
@ -788,7 +788,7 @@ void wsmenu_loop() {
/// ENTRY /// /// ENTRY ///
void setup() { void setup() {
M5.begin(); M5.begin();
M5.Axp.ScreenBreath(255); // Brightness M5.Axp.ScreenBreath(100); // Brightness
M5.Lcd.setRotation(rotation); M5.Lcd.setRotation(rotation);
M5.Lcd.setTextColor(GREEN, BLACK); M5.Lcd.setTextColor(GREEN, BLACK);
EEPROM.begin(EEPROM_SIZE); EEPROM.begin(EEPROM_SIZE);