Ejemplo n.º 1
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
#==| Turtle Gizmo Setup start |========================================
import board
import busio
import displayio
from adafruit_st7789 import ST7789
from adafruit_turtle import Color, 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 |=========================================

colors = [Color.YELLOW, Color.GREEN]

for _ in range(4):
    for i in range(5):
        turtle.pencolor(colors[i % 2])
        turtle.pendown()
        turtle.circle(60 - (i * 10))
        turtle.penup()
    turtle.right(90)

while True:
    pass
Ejemplo n.º 3
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
Ejemplo n.º 4
0
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import board
from adafruit_turtle import turtle

turtle = turtle(board.DISPLAY)
turtle.pendown()

for _ in range(32):
    turtle.circle(50, steps=6)
    turtle.right(11.1111)

while True:
    pass