Simple test

Ensure your device works with this simple test.

examples/scales_simpletest.py
 1import time
 2import board
 3import displayio
 4from scales import Scale
 5
 6display = board.DISPLAY
 7group = displayio.Group()
 8
 9values = [56, 58, 60, 65, 63, 60, 56, 54, 53, 42, 43, 44, 45, 52, 54]
10
11my_scale = Scale(
12    x=50,
13    y=220,
14    length=200,
15    direction="vertical",
16    limits=(0, 80),
17    ticks=[16, 32, 48, 64, 80],
18)
19
20group.append(my_scale)
21
22my_scale2 = Scale(
23    x=150,
24    y=100,
25    length=200,
26    direction="horizontal",
27    limits=(0, 80),
28    ticks=[16, 32, 48, 64, 80],
29)
30group.append(my_scale2)
31display.show(group)
32
33
34while True:
35    for val in values:
36        my_scale.animate_pointer(val)
37        my_scale2.animate_pointer(val)
38        time.sleep(0.1)