-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87d804b
commit 243fc61
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: Unlicense | ||
|
||
import time | ||
import board | ||
from adafruit_display_shapes.polygon import Polygon | ||
from adafruit_display_shapes.roundrect import RoundRect | ||
from circuitpython_uplot.uplot import Uplot | ||
|
||
# Setting up the display | ||
display = board.DISPLAY | ||
|
||
plot = Uplot(0, 0, display.width, display.height) | ||
|
||
# Setting up tick parameters | ||
plot.tick_params(tickheight=12, tickcolor=0xFF0008, tickgrid=True) | ||
plot.axs_params(axstype="box") | ||
plot.update_plot() | ||
|
||
polygon = Polygon( | ||
[ | ||
(255, 40), | ||
(262, 62), | ||
(285, 62), | ||
(265, 76), | ||
(275, 100), | ||
(255, 84), | ||
(235, 100), | ||
(245, 76), | ||
(225, 62), | ||
(248, 62), | ||
], | ||
outline=0x0000FF, | ||
) | ||
|
||
roundrect = RoundRect(30, 30, 61, 81, 10, fill=0x0, outline=0xFF00FF, stroke=6) | ||
|
||
plot.append(polygon) | ||
plot.append(roundrect) | ||
|
||
# Plotting and showing the plot | ||
display.show(plot) | ||
|
||
# Adding some wait time | ||
while True: | ||
time.sleep(1) |