Skip to content

Commit 6b67f65

Browse files
committed
Stellar: adjust exchange_ticker.py
1 parent 3763817 commit 6b67f65

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

micropython/examples/stellar_unicorn/exchange_ticker.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
rate_keys = []
2626

2727
# display options
28-
line_1_line = -2
29-
line_2_line = 9
30-
line_3_line = 20
28+
line_1_line = -1
29+
line_2_line = 4
30+
line_3_line = 9
3131

3232
ref_currency_index = 0
3333

34-
cycles_per_sequence = 120
34+
cycles_per_sequence = 200
3535

3636
su = StellarUnicorn()
3737
graphics = PicoGraphics(DISPLAY)
@@ -61,8 +61,8 @@ def get_data(currency_selected):
6161
graphics.set_pen(graphics.create_pen(20, 20, 20))
6262
graphics.clear()
6363
graphics.set_pen(graphics.create_pen(100, 100, 100))
64-
graphics.text("Get", 0, 10, scale=1, spacing=1)
65-
graphics.text("data", 8, 16, scale=1, spacing=1)
64+
graphics.text("Get", 0, 0, scale=1)
65+
graphics.text("data", 0, 7, scale=1)
6666
su.update(graphics)
6767
gc.collect()
6868
# open the json file
@@ -88,14 +88,11 @@ def update_display(cycle):
8888
graphics.set_pen(graphics.create_pen(20, 20, 20))
8989
graphics.clear()
9090
graphics.set_pen(graphics.create_pen(100, 0, 0))
91-
graphics.text(ref_currency_name, calculate_xpos((len(ref_currency_name)), cycle), line_1_line, scale=2, spacing=1)
91+
graphics.text(ref_currency_name, calculate_xpos((len(ref_currency_name)), cycle), line_1_line, scale=1)
9292
graphics.set_pen(graphics.create_pen(100, 100, 0))
93-
if len(currency_symbol) > 3:
94-
graphics.text(currency_symbol, calculate_xpos((len(currency_symbol)), cycle), line_2_line, scale=2, spacing=1)
95-
else:
96-
graphics.text(currency_symbol, 0, line_2_line, scale=2, spacing=1)
93+
graphics.text(currency_symbol, calculate_xpos((len(currency_symbol)), cycle), line_2_line, scale=1)
9794
graphics.set_pen(graphics.create_pen(0, 100, 100))
98-
graphics.text(currency_rate, calculate_xpos((len(currency_rate)), cycle), line_3_line, scale=2, spacing=1)
95+
graphics.text(currency_rate, calculate_xpos((len(currency_rate)), cycle), line_3_line, scale=1)
9996

10097

10198
def update_base_currency(index):

0 commit comments

Comments
 (0)