Skip to content

Commit c8e6e1f

Browse files
authored
Merge pull request #25 from caternuson/iss24_simpletest
Add simpletest
2 parents 45a5736 + 2409429 commit c8e6e1f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/pyportal_simpletest.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# NOTE: Make sure you've created your secrets.py file before running this example
2+
# https://learn.adafruit.com/adafruit-pyportal/internet-connect#whats-a-secrets-file-17-2
3+
import board
4+
from adafruit_pyportal import PyPortal
5+
6+
# Set a data source URL
7+
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
8+
9+
# Create the PyPortal object
10+
pyportal = PyPortal(url=TEXT_URL, status_neopixel=board.NEOPIXEL)
11+
12+
# Set display to show REPL
13+
board.DISPLAY.show(None)
14+
15+
# Go get that data
16+
print("Fetching text from", TEXT_URL)
17+
data = pyportal.fetch()
18+
19+
# Print out what we got
20+
print('-'*40)
21+
print(data)
22+
print('-'*40)

0 commit comments

Comments
 (0)