File tree 1 file changed +32
-0
lines changed 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ """
5
+ NOTE: This PortalBase library is intended to be subclassed by other libraries rather than
6
+ used directly by end users. This example shows one such usage with the PyPortal library.
7
+ See MatrixPortal, MagTag, and PyPortal libraries for more examples.
8
+ """
9
+ # NOTE: Make sure you've created your secrets.py file before running this example
10
+ # https://learn.adafruit.com/adafruit-pyportal/internet-connect#whats-a-secrets-file-17-2
11
+
12
+
13
+ import board
14
+ from adafruit_pyportal import PyPortal
15
+
16
+ # Set a data source URL
17
+ TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
18
+
19
+ # Create the PyPortal object
20
+ pyportal = PyPortal (url = TEXT_URL , status_neopixel = board .NEOPIXEL )
21
+
22
+ # Set display to show REPL
23
+ board .DISPLAY .show (None )
24
+
25
+ # Go get that data
26
+ print ("Fetching text from" , TEXT_URL )
27
+ data = pyportal .fetch ()
28
+
29
+ # Print out what we got
30
+ print ("-" * 40 )
31
+ print (data )
32
+ print ("-" * 40 )
You can’t perform that action at this time.
0 commit comments