Turning screen on/off

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ravpigeon
 
Posts: 2
Joined: Mon Feb 01, 2021 9:54 am

Turning screen on/off

Post by ravpigeon »

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)

User avatar
dastels
 
Posts: 15658
Joined: Tue Oct 20, 2015 3:22 pm

Re: Turning screen on/off

Post by dastels »

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

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

Re: Turning screen on/off

Post by ravpigeon »

Thanks, I'll try that!

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: Turning screen on/off

Post by kevinjwalters »

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

import board
board.DISPLAY.auto_refresh = False

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”