Skip to content

Commit e1c9f4b

Browse files
committed
update code.py to pull from new data source... for real
1 parent cea0400 commit e1c9f4b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

PyPortal_on_this_day/code.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""
2+
'of this day' demo
3+
Display notable info about famous electronics-related peoples
4+
Data sources: https://github.com/adafruit/OTD/tree/master/electronics
5+
"""
6+
17
import random
28
import board
39
import time
@@ -12,13 +18,13 @@
1218
ACCOMPLISH = ["Accomplishment"]
1319
WEB = ["Web Reference"]
1420

15-
DATA = cwd+"/local.txt"
21+
DATA = "https://raw.githubusercontent.com/adafruit/OTD/master/electronics/01_01.json"
1622

1723
# create pyportal object w no data source (we'll feed it text later)
1824
pyportal = PyPortal(url = DATA,
1925
json_path = (DAY, PERSON, NOTABLE, YEAR, ACCOMPLISH, WEB),
2026
status_neopixel = board.NEOPIXEL,
21-
default_bg = none,
27+
default_bg = cwd + "/on_this_day_bg.bmp",
2228
text_font = cwd+"fonts/Arial-ItalicMT-17.bdf",
2329
text_position=((10, 70), (10, 100), (10, 130),(60, 160), (105, 190), (10, 220)),
2430
text_color=(0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF),

0 commit comments

Comments
 (0)