File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed
Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 1+ * .mpy
2+ .idea
13__pycache__
24_build
35* .pyc
46.env
57build *
68bundles
9+ * .DS_Store
10+ .eggs
11+ dist
12+ ** /* .egg-info
Original file line number Diff line number Diff line change 1+ """
2+ This example show the use of the backlight as well as using labels to simulate
3+ a terminal using a font on the PyPortal
4+ """
5+
16import os
27import time
38import board
4- import pulseio
5- import microcontroller
69import displayio
710
811from adafruit_bitmap_font import bitmap_font
912from adafruit_display_text .label import Label
1013
11- backlight = pulseio .PWMOut (microcontroller .pin .PB21 ) #pylint: disable=no-member
12-
13- max_brightness = 2 ** 15
14-
1514fonts = list (filter (lambda x : x .endswith ("bdf" ) and not x .startswith ("." ), os .listdir ("/" )))
1615fonts = [bitmap_font .load_font (x ) for x in fonts ]
1716
18-
1917print ("fade up" )
2018# Fade up the backlight
2119for b in range (100 ):
22- backlight . duty_cycle = b * max_brightness / / 100
20+ board . DISPLAY . brightness = b / 100
2321 time .sleep (0.01 ) # default (0.01)
2422
2523demos = ["CircuitPython = Code + Community" , "accents - üàêùéáçãÍóí" , "others - αψ◌" ]
4038 # Wait for the image to load.
4139 board .DISPLAY .wait_for_frame ()
4240
43- # Wait forever
41+ # Wait for 10 minutes (600 seconds)
4442time .sleep (600 )
4543
4644# Fade down the backlight
47- for b in range (50 , - 1 , - 1 ):
48- backlight . duty_cycle = b * max_brightness / / 100
49- time .sleep (0.005 ) # default (0.005 )
45+ for b in range (100 , - 1 , - 1 ):
46+ board . DISPLAY . brightness = b / 100
47+ time .sleep (0.01 ) # default (0.01 )
5048
5149print ("fade down" )
5250
53- # splash.pop( )
51+ time . sleep ( 10 )
You can’t perform that action at this time.
0 commit comments