|
20 | 20 | # Create a Cartesian widget
|
21 | 21 | # https://circuitpython.readthedocs.io/projects/displayio-layout/en/latest/api.html#module-adafruit_displayio_layout.widgets.cartesian
|
22 | 22 | 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 |
26 | 26 | 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 |
29 | 29 | )
|
30 | 30 |
|
31 | 31 | my_group = displayio.Group()
|
32 | 32 | my_group.append(my_plane)
|
33 | 33 | display.show(my_group) # add high level Group to the display
|
34 | 34 |
|
35 | 35 | 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), |
37 | 51 | (10, 10),
|
38 |
| - (30, 10), |
39 |
| - (50, 50), |
40 |
| - (70, 30), |
41 |
| - (90, 80), |
42 |
| - (95, 80), |
43 |
| - (100, 100), |
44 | 52 | ]
|
45 | 53 |
|
46 | 54 | print("examples/displayio_layout_cartesian_lineplot.py")
|
| 55 | + |
| 56 | +# first point without a wait. |
| 57 | +my_plane.update_line(0, 0) |
47 | 58 | for x, y in data:
|
48 | 59 | my_plane.update_line(x, y)
|
49 |
| - time.sleep(1) |
| 60 | + time.sleep(0.5) |
50 | 61 |
|
51 | 62 | while True:
|
52 | 63 | pass
|
0 commit comments