Is there anything (except the pause menu) which will allow me to change the brightness of the display?

I’m working on this Vpet game and i want it to have a sort of power saving feature so when you don’t use it it turns of the brightness and keeps the clock running. for now i am going to use the color fading extension.

TL;DR: i am making a tamagotchi and i want the screen to turn off but keep the program running when unused.

2 Likes

This doesn’t fix your problem but you could 1. Use light to dim it and 2. use settings so you can save your progress/state of the tamagotchi.

2 Likes

Hello! I created an extension just now for changing the brightness through blocks. I saw that other people were asking about this same thing. Here’s the extension that allows you to change the brightness of your screen:

Hope this helps!

6 Likes

Thanks for saving a lot of my time. the extension does work but because makecode won’t let me set the brightness below 10 i will have to try and find a way to be able to disable that limiter

1 Like

i ended up making an issue report on the makecode arcade github

2 Likes

This is crazy late and I apologize, but yeah, I couldn’t figure out what was stopping it from going below 10…
I see you’ve made an issue already though so :ok_hand:

I HAVE FOUND THE SOLUTION:

pins.pinByCfg(DAL.CFG_PIN_DISPLAY_BL).digitalWrite(false);

the simulator won’t like it if you just put the line down so I’d suggest you put it in an if statement

(example)

const bl = pins.pinByCfg(DAL.CFG_PIN_DISPLAY_BL);
if (bl) {
    bl.digitalWrite(false);
}
1 Like

i found a major bug where using digitalwrite it will mess up audio, here is the new version:

(pins.pinByCfg(DAL.CFG_PIN_DISPLAY_BL) as PwmOnlyPin).analogWrite(0)

or

const bl = pins.pinByCfg(DAL.CFG_PIN_DISPLAY_BL) as PwmOnlyPin
if (bl) {
    bl.analogWrite(0)
}
1 Like

I’ll make these changes when I can! :+1:
I’m just currently putting all my attention on the game jam

1 Like