Skip to main content

Turtle graphics library for CircuitPython and displayio

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

Turtle graphics library for CircuitPython and displayio

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-turtle

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-turtle

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-turtle

Usage Example

import board
from adafruit_turtle import Color, turtle

turtle = turtle(board.DISPLAY)
starsize = min(board.DISPLAY.width, board.DISPLAY.height) * 0.9  # 90% of screensize

print("Turtle time! Lets draw a star")

turtle.pencolor(Color.BLUE)

turtle.penup()
turtle.goto(-starsize/2, 0)
turtle.pendown()

start = turtle.pos()
while True:
    turtle.forward(starsize)
    turtle.left(170)
    if abs(turtle.pos() - start) < 1:
        break

while True:
    pass

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit-circuitpython-turtle-2.2.9.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file adafruit-circuitpython-turtle-2.2.9.tar.gz.

File metadata

File hashes

Hashes for adafruit-circuitpython-turtle-2.2.9.tar.gz
Algorithm Hash digest
SHA256 28e97fb6abad6a8beac3782be3786197ec65f9ee14be3d09167b0314396df5ed
MD5 0f5a172d88d4d09264e9ab676b31e796
BLAKE2b-256 825680bd8acf39d16b85234b3652a12e4ccafc0f577b8ee8887410277b9831ea

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_turtle-2.2.9-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_turtle-2.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 e23dde9254116dda883e97baed822176b0e8062fa2fe9306fc710158b9e0d66d
MD5 4c93bfc5fba8ed74bee071e79501685f
BLAKE2b-256 71ac29afd892eee9b31936f38ea46c611d469da14f48136cd4d6d852154ed4c7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page