Fixed the OnDiskBitmap example to reflect code changes

This commit is contained in:
Bryan Siepert 2019-03-02 09:12:40 -08:00
parent 17bf2afa41
commit 945550f4bd

View File

@ -52,21 +52,22 @@
//| import time //| import time
//| import pulseio //| import pulseio
//| //|
//| backlight = pulseio.PWMOut(board.TFT_BACKLIGHT) //| board.DISPLAY.auto_brightness = False
//| board.DISPLAY.brightness = 0
//| splash = displayio.Group() //| splash = displayio.Group()
//| board.DISPLAY.show(splash) //| board.DISPLAY.show(splash)
//| //|
//| with open("/sample.bmp", "rb") as f: //| with open("/sample.bmp", "rb") as f:
//| odb = displayio.OnDiskBitmap(f) //| odb = displayio.OnDiskBitmap(f)
//| face = displayio.Sprite(odb, pixel_shader=displayio.ColorConverter(), position=(0,0)) //| face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter(), position=(0,0))
//| splash.append(face) //| splash.append(face)
//| # Wait for the image to load. //| # Wait for the image to load.
//| board.DISPLAY.wait_for_frame() //| board.DISPLAY.wait_for_frame()
//| //|
//| # Fade up the backlight //| # Fade up the backlight
//| for i in range(100): //| for i in range(100):
//| backlight.duty_cycle = i * (2 ** 15) // 100 //| board.DISPLAY.brightness = 0.01 * i
//| time.sleep(0.01) //| time.sleep(0.05)
//| //|
//| # Wait forever //| # Wait forever
//| while True: //| while True: