updating pyportal guitar tuner
Updating the PyPortal Guitar Tuner code to use default_bg with the PyPortal rather than create a tilegrid.
This commit is contained in:
parent
1e310a9885
commit
a05c89ca2e
1 changed files with 1 additions and 15 deletions
|
|
@ -1,20 +1,8 @@
|
|||
import time
|
||||
import board
|
||||
import displayio
|
||||
import adafruit_imageload
|
||||
from adafruit_button import Button
|
||||
from adafruit_pyportal import PyPortal
|
||||
|
||||
display = board.DISPLAY
|
||||
|
||||
pyportal = PyPortal()
|
||||
|
||||
bitmap, palette = adafruit_imageload.load("/stock-pyportal.bmp",
|
||||
bitmap=displayio.Bitmap,
|
||||
palette=displayio.Palette)
|
||||
|
||||
# Create a TileGrid to hold the bitmap
|
||||
tile_grid = displayio.TileGrid(bitmap, pixel_shader=palette)
|
||||
pyportal = PyPortal(default_bg="/stock-pyportal.bmp")
|
||||
|
||||
lowE = "/sounds/lowE.wav"
|
||||
A = "/sounds/A.wav"
|
||||
|
|
@ -34,8 +22,6 @@ pegs = [
|
|||
{'label': "highE", 'pos': (53, 150), 'size': (65, 90)}
|
||||
]
|
||||
|
||||
pyportal.splash.append(tile_grid)
|
||||
|
||||
buttons = []
|
||||
for peg in pegs:
|
||||
button = Button(x=peg['pos'][0], y=peg['pos'][1],
|
||||
|
|
|
|||
Loading…
Reference in a new issue