Simple test

Ensure your device works with this simple test.

examples/turtle_simpletest.py
 1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
 2# SPDX-License-Identifier: MIT
 3
 4import board
 5from adafruit_turtle import Color, turtle
 6
 7turtle = turtle(board.DISPLAY)
 8starsize = min(board.DISPLAY.width, board.DISPLAY.height) * 0.9  # 90% of screensize
 9
10print("Turtle time! Lets draw a star")
11
12turtle.pencolor(Color.BLUE)
13turtle.setheading(90)
14
15turtle.penup()
16turtle.goto(-starsize / 2, 0)
17turtle.pendown()
18
19start = turtle.pos()
20while True:
21    turtle.forward(starsize)
22    turtle.left(170)
23    if abs(turtle.pos() - start) < 1:
24        break
25
26while True:
27    pass