Turtle graphics library for CircuitPython and displayio
Project description
Introduction
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file adafruit_circuitpython_turtle-3.0.2.tar.gz
.
File metadata
- Download URL: adafruit_circuitpython_turtle-3.0.2.tar.gz
- Upload date:
- Size: 36.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcefcc0b9ace830376fa1aa0fe4717b4c199f53a9c28c1990a66461faa501364 |
|
MD5 | ccceebf5924836cb996c64938e0e1894 |
|
BLAKE2b-256 | 509528cbf22ae2cb4ab23768da3ce5c824b2d98564247748e5037fe4f8658520 |
File details
Details for the file adafruit_circuitpython_turtle-3.0.2-py3-none-any.whl
.
File metadata
- Download URL: adafruit_circuitpython_turtle-3.0.2-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c72299210dc9278052739260f415762b25df93909b08009076c35f4cba1150eb |
|
MD5 | 313df00536bdec2df9f8df05f31b131c |
|
BLAKE2b-256 | d748e0ef45f8a8fb77bf0a58a009a249cce7bf87583dd0798aca2fa991446acb |