Exemple #1
0
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import board
from adafruit_turtle import Color, turtle

turtle = turtle(board.DISPLAY)

mycolors = [Color.WHITE, Color.RED, Color.BLUE, Color.GREEN, Color.ORANGE, Color.PURPLE]
turtle.penup()
turtle.forward(130)
turtle.right(180)
turtle.pendown()

for i in range(6):
    turtle.pencolor(mycolors[i])
    turtle.circle(25)
    turtle.penup()
    turtle.forward(50)
    turtle.pendown()

while True:
    pass
Exemple #2
0
# Turtle Gizmo Circle
#==| Turtle Gizmo Setup start |========================================
import board
import busio
import displayio
from adafruit_st7789 import ST7789
from adafruit_turtle import turtle
displayio.release_displays()
spi = busio.SPI(board.SCL, MOSI=board.SDA)
display_bus = displayio.FourWire(spi, command=board.TX, chip_select=board.RX)
display = ST7789(display_bus,
                 width=240,
                 height=240,
                 rowstart=80,
                 backlight_pin=board.A3,
                 rotation=180)
turtle = turtle(display)
#==| Turtle Gizmo Setup end |=========================================

turtle.penup()
turtle.right(90)
turtle.forward(118)
turtle.left(90)
turtle.pendown()
turtle.circle(118)  #radius of the circle

while True:
    pass
random_color = False
color_choice = 6

# buttons
but_a = False
but_b = False

# pause

pause = False

# Warp

warp = False

turtle1 = turtle(display)

print("Turtle time! Lets follow the slippery slope...")

colors = (Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, Color.BLUE,
          Color.PURPLE, Color.WHITE, Color.PINK)

turtle1.pendown()

while True:
    # Turtle gravity esk-a-sketch
    angle, z = get_angle()
    # wraparound to stay on the display
    t1x, t1y = turtle1.pos()
    #print(t1x, t1y)