Skip to content

Commit

Permalink
Update code.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCruz committed Nov 3, 2021
1 parent 2d58114 commit 4f60cc9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#MatrixPortal Stock Ticker
#by Mario the Maker
#
#https://github.com/MarioCruz/MatrixPortalStockTicker/
#Nov 3, 2021
import time
import board
import terminalio
Expand All @@ -11,7 +12,7 @@
#Change the Stock1 to be the Stock Symbol you want
STOCK1 = "WSO"
# Set up where we'll be fetching data from
# Go here https://finnhub.io/ get an free ApiKey
# Go here https://finnhub.io/ get a free ApiKey
DATA_SOURCE = (
"https://finnhub.io/api/v1/quote?symbol=" + STOCK1 + "&token=EnterApiTokenHere"
)
Expand Down Expand Up @@ -108,7 +109,7 @@ def text_Change(val):
last_check = None

while True:
if last_check is None or time.monotonic() > last_check + 280:
if last_check is None or time.monotonic() > last_check + 280:#How long to wait to get new data in seconds
try:
value = matrixportal.fetch()
print("Response is",value)
Expand All @@ -117,4 +118,4 @@ def text_Change(val):
except (ValueError, RuntimeError) as e:
print("Some error occured, retrying! -", e)
matrixportal.scroll()
time.sleep(.0195)
time.sleep(.0195) #How Fast to Scroll

0 comments on commit 4f60cc9

Please sign in to comment.