Skip to content

Commit 779fc7a

Browse files
committed
cleanup example
1 parent 9661bce commit 779fc7a

File tree

2 files changed

+24
-82
lines changed

2 files changed

+24
-82
lines changed

examples/displayio_layout_cartesian_dev.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

examples/displayio_layout_cartesian_lineplot.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,44 @@
2020
# Create a Cartesian widget
2121
# https://circuitpython.readthedocs.io/projects/displayio-layout/en/latest/api.html#module-adafruit_displayio_layout.widgets.cartesian
2222
my_plane = Cartesian(
23-
x=20, # x position for the plane
24-
y=0, # y plane position
25-
width=130, # display width
23+
x=15, # x position for the plane
24+
y=2, # y plane position
25+
width=140, # display width
2626
height=105, # display height
27-
xrange=(0, 100), # x range
28-
yrange=(0, 100), # y range
27+
xrange=(0, 10), # x range
28+
yrange=(0, 10), # y range
2929
)
3030

3131
my_group = displayio.Group()
3232
my_group.append(my_plane)
3333
display.show(my_group) # add high level Group to the display
3434

3535
data = [
36-
(0, 0),
36+
# (0, 0), # we do this point manually - so we have no wait...
37+
(1, 1),
38+
(2, 1),
39+
(2, 2),
40+
(3, 3),
41+
(4, 3),
42+
(4, 4),
43+
(5, 5),
44+
(6, 5),
45+
(6, 6),
46+
(7, 7),
47+
(8, 7),
48+
(8, 8),
49+
(9, 9),
50+
(10, 9),
3751
(10, 10),
38-
(30, 10),
39-
(50, 50),
40-
(70, 30),
41-
(90, 80),
42-
(95, 80),
43-
(100, 100),
4452
]
4553

4654
print("examples/displayio_layout_cartesian_lineplot.py")
55+
56+
# first point without a wait.
57+
my_plane.update_line(0, 0)
4758
for x, y in data:
4859
my_plane.update_line(x, y)
49-
time.sleep(1)
60+
time.sleep(0.5)
5061

5162
while True:
5263
pass

0 commit comments

Comments
 (0)