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.17.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for adafruit-circuitpython-turtle-2.2.17.tar.gz
Algorithm Hash digest
SHA256 221a6b3a7741e740c3059bdbf708d6f493d9f4d890b0a099bbf4409eb996f6a5
MD5 62b14ba7b8c6cf49f63b6e98a245ef2d
BLAKE2b-256 933c270936861a033277c58a6ebe1723c2c15a127aced1eb9f0c681f7c3e2f85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_turtle-2.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 3871bf3974a083aa1bdf8994fb1f1512c1f912c228f57658029c0c69107a9916
MD5 2d3df62c5e7542d94e83c40da91523f1
BLAKE2b-256 a8802dd2e1d9283e79bc300a050d6e7f3808d545b0f767a89741872c0eb41c2e

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