Skip to content

Instantly share code, notes, and snippets.

@vwillcox
Last active September 7, 2022 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vwillcox/c82fdf60bade293668d2d17abd9c5f09 to your computer and use it in GitHub Desktop.
Save vwillcox/c82fdf60bade293668d2d17abd9c5f09 to your computer and use it in GitHub Desktop.
Scroll the current people aboard the ISS on a Raspberry Pi Pico W With a Pimoroni Unicorn Pack Attached.
# Based on
# Scroller Demo
# Kevin McAleer May 2022
# Additional code by Vincent Willcox September 2022
import network
import secrets
import time
import urequests
from scroller import Scroller
from time import sleep
# create a scroller 0bject
scroll = Scroller()
# set the hue colour (0 is red etc)
hue = 0.8
scroll.clear()
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(secrets.SSID, secrets.PASSWORD)
print(wlan.isconnected())
while True or KeyboardInterrupt:
astronauts = urequests.get("http://api.open-notify.org/astros.json").json()
number = astronauts['number']
for i in range(number):
message = astronauts['people'][i]['name']
#message = "There are currently " + message + " people on the ISS"
for position in range(16, -len(message*(5+1)),-1):
scroll.show_message(message, position, hue)
sleep(0.01 )
scroll.clear()
SSID = "SSID" # Your SSID
PASSWORD = "PASSWORD" # Your Wifi Password
@vwillcox
Copy link
Author

vwillcox commented Sep 7, 2022

You will need the rest of the code from Kevin's Git Hub
You will also need to create a secrets.py file with your WIFI SSID and WiFi Password:

SSID = "SSID"
PASSWORD = "PASSWORD"

See : https://github.com/kevinmcaleer/unicorn_scroller for more information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment