-
Notifications
You must be signed in to change notification settings - Fork 2
Code
This code can be downloaded on to your computer here. Transfer all the files except for the README.md file to your PyPortal. You'll just drag and drop them on the PyPortal, which should show up as CIRCUITPYTHON on your USB list. The only document you should need to edit is the secrets.py. It will pull all your private information into the code so we don't have it out in plain sight.
I would recommend using the Mu Editor to edit and view your code. It has a serial monitor for easy debugging while you make changes. Any code editor will work though.
I want to talk through what each piece of code, libraries, and folders do so it's easier to make changes and
code.py
This is our main file that initiates on the PyPortal since it is named code.py. Here you'll see the WiFi connect, the Dark Sky API call, and the setup for the PyPortal display. There isn't any modifications you need to make to this file.
darksky.py
This script is called from the main code. This is where we parse the Dark Sky API call, setup text location on the PyPortal display, determine which icon to display, and send the API data to Initial State. There isn't any modifications you need to make here.
secrets.py
This holds all your passwords and access keys. You will need to update almost all items in this document. You will need to enter your WiFi name, WiFi password, timezone, Dark Sky API key, Initial State access key, longitude & latitude, city name & state, Adafruit IO username, and Adafruit IO key. Once you have all those entered and saved your code should run without error.
libraries
These are the libraries required to run the PyPortal and modules.
fonts
This is the font used to display the weather information on the PyPortal.
icons
These are the different icons that are display as the picture on the PyPortal based on the current weather conditions.
Initial State (www.initialstate.com)
(c) 2019 Initial State Technologies, Inc.