Simple test

Ensure your device works with this simple test.

examples/displayio_cartesian_simpletest.py
1# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2# SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
3#
4# SPDX-License-Identifier: Unlicense

Advanced test

Advanced test showing illustrating usage of more features.

examples/displayio_cartesian_advanced_test.py
 1# SPDX-FileCopyrightText: 2021 Jose David M.
 2#
 3# SPDX-License-Identifier: MIT
 4#############################
 5"""
 6This is a more advance demonstration of a Cartesian widget and some configurable
 7parameters.
 8"""
 9
10import board
11import displayio
12import terminalio
13
14from displayio_cartesian import Cartesian
15
16# Fonts used for the Dial tick labels
17tick_font = terminalio.FONT
18
19display = board.DISPLAY  # create the display on the PyPortal or Clue (for example)
20# otherwise change this to setup the display
21# for display chip driver and pinout you have (e.g. ILI9341)
22
23
24# Create different Cartesian widgets
25my_group = displayio.Group()
26
27car = Cartesian(
28    x=25,
29    y=10,
30    width=100,
31    height=100,
32    subticks=True,
33)
34my_group.append(car)
35
36car3 = Cartesian(
37    x=150,
38    y=10,
39    width=150,
40    height=100,
41    xrange=(0, 160),
42    axes_stroke=1,
43    axes_color=0x990099,
44    subticks=True,
45)
46my_group.append(car3)
47
48car4 = Cartesian(
49    x=30,
50    y=140,
51    width=80,
52    height=80,
53    axes_stroke=1,
54    tick_color=0xFFFFFF,
55    subticks=True,
56)
57
58my_group.append(car4)
59
60car5 = Cartesian(
61    x=180,
62    y=140,
63    width=70,
64    height=70,
65    xrange=(0, 120),
66    yrange=(0, 90),
67    tick_color=0x990099,
68    axes_stroke=3,
69    major_tick_length=10,
70)
71my_group.append(car5)
72
73display.show(my_group)
74
75while True:
76    pass