Simple test

Ensure your device works with this simple test.

examples/candlesticks_simpletest.py
 1# SPDX-FileCopyrightText: 2021 Jose David M.
 2#
 3# SPDX-License-Identifier: MIT
 4#############################
 5"""
 6This is a simple example of the use of the class candlestick.
 7"""
 8
 9# import candlesticks_simpletest
10
11import displayio
12import board
13from candlesticks import Candlestick
14
15display = board.DISPLAY
16
17my_candle = Candlestick(
18    100,
19    60,
20    30,
21    80,
22    5,
23    color_green=0x00FF00,
24    color_red=0xFF0000,
25    screen_ref=180,
26)
27
28my_candle2 = Candlestick(
29    120,
30    43,
31    60,
32    80,
33    25,
34    color_green=0x00FF00,
35    color_red=0xFF0000,
36    screen_ref=180,
37)
38
39my_candle3 = Candlestick(
40    140,
41    10,
42    45,
43    65,
44    25,
45    color_green=0x00FF00,
46    color_red=0xFF0000,
47    screen_ref=180,
48)
49
50my_candle4 = Candlestick(
51    160,
52    85,
53    15,
54    85,
55    15,
56    color_green=0x00FF00,
57    color_red=0xFF0000,
58    screen_ref=180,
59)
60my_candle5 = Candlestick(
61    180,
62    15,
63    25,
64    85,
65    30,
66    color_green=0x00FF00,
67    color_red=0xFF0000,
68    screen_ref=180,
69)
70
71
72main_group = displayio.Group()
73main_group.append(my_candle.my_rep)
74main_group.append(my_candle2.my_rep)
75main_group.append(my_candle3.my_rep)
76main_group.append(my_candle4.my_rep)
77main_group.append(my_candle5.my_rep)
78
79display.show(main_group)
80
81while True:
82    pass