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
5
6from adafruit_turtle import Color, turtle
7
8turtle = turtle(board.DISPLAY)
9starsize = min(board.DISPLAY.width, board.DISPLAY.height) * 0.9 # 90% of screensize
10
11print("Turtle time! Lets draw a star")
12
13turtle.pencolor(Color.BLUE)
14turtle.setheading(90)
15
16turtle.penup()
17turtle.goto(-starsize / 2, 0)
18turtle.pendown()
19
20start = turtle.pos()
21while True:
22 turtle.forward(starsize)
23 turtle.left(170)
24 if abs(turtle.pos() - start) < 1:
25 break
26
27while True:
28 pass