0

Turning screen on/off
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Turning screen on/off

by ravpigeon on Mon Feb 01, 2021 10:01 am

Apologies if this has been asked before (I tried searching but only found this other recent topic https://forums.adafruit.com/viewtopic.php?f=65&t=173653), but I was wondering if I can turn on and off the CLUE screen using CircuitPython. I only recently got my CLUE so I'm an absolute beginner and I wanted to get it working as a passive plant moisture monitor (I've also got the Buckaroo Bonsai board) but without a pump. I thought I would have the board connected to my pot plant for long periods and it seems like it would be a waste of battery power to have the screen constantly displaying. I thought I would be able to leave the screen off most of the time and just to turn it on with one of the A or B buttons for a few seconds before it would turn off again. Is this possible? (I've tried looking through quite a few examples but they all seem to indicate that the screen is always turned on)

ravpigeon
 
Posts: 2
Joined: Mon Feb 01, 2021 9:54 am

Re: Turning screen on/off

by dastels on Mon Feb 01, 2021 10:51 am

Probably the best you can do (which is a lot) is to control the TFT backlight.

Use board.DISPLAY.brightness = <value from 0.0 to 1.0>

0.0 = off, 1.0 = fully on.

Dave

dastels
 
Posts: 6514
Joined: Tue Oct 20, 2015 3:22 pm

Re: Turning screen on/off

by ravpigeon on Mon Feb 01, 2021 11:13 am

Thanks, I'll try that!

ravpigeon
 
Posts: 2
Joined: Mon Feb 01, 2021 9:54 am

Re: Turning screen on/off

by kevinjwalters on Thu Feb 04, 2021 8:44 am

The serial console output also goes to the screen even with the backlight off. This will cause any print() statements in your code (or libraries) to waste CPU updating the screen. That tends to be viewed more as a performance inefficiency but for some other programs that would also equate to more power use.

I use this to turn off those updates:

Code: Select all | TOGGLE FULL SIZE
import board
board.DISPLAY.auto_refresh = False

kevinjwalters
 
Posts: 962
Joined: Sun Oct 01, 2017 3:15 pm

Please be positive and constructive with your questions and comments.