Turning screen on/off
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ravpigeon
- Posts: 2
- Joined: Mon Feb 01, 2021 9:54 am
Turning screen on/off
Apologies if this has been asked before (I tried searching but only found this other recent topic 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)
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Turning screen on/off
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
Use board.DISPLAY.brightness = <value from 0.0 to 1.0>
0.0 = off, 1.0 = fully on.
Dave
- ravpigeon
- Posts: 2
- Joined: Mon Feb 01, 2021 9:54 am
Re: Turning screen on/off
Thanks, I'll try that!
- kevinjwalters
- Posts: 1025
- Joined: Sun Oct 01, 2017 3:15 pm
Re: Turning screen on/off
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:
I use this to turn off those updates:
Code: Select all
import board
board.DISPLAY.auto_refresh = False
Please be positive and constructive with your questions and comments.