Sadly, nope. I’ve deleted all the fonts, except one. Same issue. Device is stuck on a grey/black-lit screen.
#IMPORT LIBRARIES
from picographics import PicoGraphics, DISPLAY_TUFTY_2040
from picovector import PicoVector, ANTIALIAS_NONE, ANTIALIAS_X4, ANTIALIAS_X16
#SET DISPLAY
display = PicoGraphics(display=DISPLAY_TUFTY_2040)
#SET VECTOR, ANTIALIASING & FONT TYPE {download.af fonts from resources above. Upload through Thonny in root "/" }
vector = PicoVector(display)
vector.set_antialiasing(ANTIALIAS_X4)
result = vector.set_font("IndieFlower-Regular.af", 50) #vector.setfont("font-name-directory",font-size-int)
#SET PALETTE
WHITE = display.create_pen(255,255,255)
BLACK = display.create_pen(0,0,0)
while True:
#BLACK BG
display.set_pen(BLACK)
display.clear()
#SET PEN AND DISPLAY TEXT - vector.text("TextHere",X,Y,ANGLEDEG)
display.set_pen(WHITE)
vector.text("Hello World!", 60, 90, 0)
#UPDATE SCREEN
display.update()
HOWEVER in this example, you can see the device itself is still processing (console output is filtering in) – but no screen:
import time
import math
import random
import machine
from picographics import PicoGraphics, DISPLAY_TUFTY_2040, PEN_RGB332
from picovector import PicoVector, Polygon, RegularPolygon, Rectangle, ANTIALIAS_NONE, ANTIALIAS_X4, ANTIALIAS_X16
machine.freq(250_000_000)
display = PicoGraphics(DISPLAY_TUFTY_2040, pen_type=PEN_RGB332)
display.set_backlight(0.8)
vector = PicoVector(display)
vector.set_antialiasing(ANTIALIAS_NONE)
RED = display.create_pen(255, 0, 0)
ORANGE = display.create_pen(255, 128, 0)
YELLOW = display.create_pen(255, 255, 0)
GREEN = display.create_pen(0, 255, 0)
BLUE = display.create_pen(0, 0, 255)
VIOLET = display.create_pen(255, 0, 255)
BLACK = display.create_pen(0, 0, 0)
GREY = display.create_pen(128, 128, 128)
WHITE = display.create_pen(255, 255, 255)
result = vector.set_font("IndieFlower-Regular.af", 30)
WIDTH, HEIGHT = display.get_bounds()
X = int(WIDTH / 2)
Y = int(HEIGHT / 2)
a = 0
frames = 0
t_count = 0
t_total = 0
while True:
tstart = time.ticks_ms()
display.set_pen(BLACK)
display.clear()
for x in range(8):
c = 31 + (x * 32)
display.set_pen(display.create_pen(255-c, 0, c))
vector.text("Hello World\nHello World", X, Y, angle=x * 45 + a)
display.update()
a += 1
tfinish = time.ticks_ms()
total = tfinish - tstart
t_total += total
t_count += 1
if t_count == 60:
per_frame_avg = t_total / t_count
print(f"60 frames in {t_total}ms, avg {per_frame_avg:.02f}ms per frame, {1000/per_frame_avg:.02f} FPS")
t_count = 0
t_total = 0
# pause for a moment (important or the USB serial device will fail)
# try to pace at 60fps or 30fps
if total > 1000 / 30:
time.sleep(0.0001)
elif total > 1000 / 60:
t = 1000 / 30 - total
time.sleep(t / 1000)
else:
t = 1000 / 60 - total
time.sleep(t / 1000)
I am at a total lose as to why this is happening…