I was playing with PicoVector API on the Presto and have come across an issue. Before I submit a bug report, could some see if this code works for them. It just draws a few arcs, but seems to sometimes lock the Presto requiring a reset to get it back to life. A couple of times not even a reset worked and it needed to be re-flashed.
from presto import Presto
from picovector import PicoVector, Polygon, Transform, ANTIALIAS_FAST
# Setup for the Presto display
presto = Presto(layers = 1, full_res=False, ambient_light=False)
display = presto.display
vector = PicoVector(display)
vector.set_antialiasing(ANTIALIAS_FAST)
WIDTH, HEIGHT = display.get_bounds()
# Couple of colours for use later
BLACK = display.create_pen(0,0,0)
BLUE = display.create_pen(0,0, 202)
RED = display.create_pen(200,0,0)
WHITE = display.create_pen(255, 255, 255)
GREEN = display.create_pen(0,255,0)
YELLOW = display.create_pen(0,255,255)
def draw_arc(x,y,r,q,c):
# x,y = centre, r = radius, q = quadrant, c = circle position
# if centre of flow at x,y, then calculate co-ord for arc centre
# and start and end angles
if q == 1:
xpos = x-r
ypos = y-r
astart = 0
aend = 90
elif q == 2:
xpos = x+r
ypos = y-r
astart = 0
aend = -90
elif q == 3:
xpos = x+r
ypos = y+r
astart = 180
aend = 270
elif q == 4:
xpos = x-r
ypos = y+r
astart = 90
aend = 180
arc_a = Polygon()
arc_a.arc(xpos,ypos,r, astart, aend, 3)
# arc_a.circle(xpos,ypos,r,3)
vector.draw(arc_a)
# Clear the screen and use blue as the background colour
display.set_pen(BLUE)
display.clear()
display.set_pen(WHITE)
xpos=120
ypos=100
radius = 75
sc = 0.7
for i in range(10,12):
display.set_pen(BLACK)
display.clear()
display.set_pen(RED)
draw_arc(xpos,ypos,radius,1,i)
display.set_pen(BLUE)
draw_arc(xpos,ypos,radius,2,int(i/2))
display.set_pen(GREEN)
draw_arc(xpos,ypos,radius,3,int(i/5))
display.set_pen(YELLOW)
draw_arc(xpos,ypos,radius,4,int((i*5) % 90))
presto.update()