PyPortal - Python powered Iot device for displaying quotes @adafruit #adafruit #iot

Subscribers:
460,000
Published on ● Video Link: https://www.youtube.com/watch?v=XCZXmXO-Kko



Duration: 0:58
3,776 views
77


Beta of Python powered Iot device for displaying quotes from https://www.adafruit.com/quotes

code sample...

import time
import board
from adafruit_pyportal import PyPortal
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.text_area import TextArea

# Set up where we'll be fetching data from
DATA_SOURCE = "https://www.adafruit.com/api/quotes.php"
QUOTE_LOCATION = [0, 'text']
AUTHOR_LOCATION = [0, 'author']

cwd = __file__.rsplit('/', 1)[0]
pyportal = PyPortal(url=DATA_SOURCE,
json_path=(QUOTE_LOCATION, AUTHOR_LOCATION),
status_neopixel=board.NEOPIXEL,
default_bg=cwd+"/quote_background.bmp",
text_font="/fonts/Arial-ItalicMT-17.bdf",
text_position=((20, 40), # quote location
(5, 190)), # author location
text_color=(0xFFFFFF, # quote text color
0x8080FF), # author text color
text_wrap=(35, # characters to wrap for quote
0), # no wrap for author
text_maxlen=(180, 30) # max text size for quote & author
)

while True:
try:
value = pyportal.fetch()
print("Response is", value)
except RuntimeError as e:
print("Some error occured, retrying! -", e)
time.sleep(5)

Visit the Adafruit shop online - http://www.adafruit.com

-----------------------------------------
LIVE CHAT IS HERE! http://adafru.it/discord

Adafruit on Instagram: https://www.instagram.com/adafruit

Subscribe to Adafruit on YouTube: http://adafru.it/subscribe

Join our weekly Show & Tell on G+ Hangouts On Air: http://adafru.it/showtell

New tutorials on the Adafruit Learning System: http://learn.adafruit.com/
-----------------------------------------




Other Videos By Adafruit Industries


2019-02-13Bluefruit Rover in CircuitPython demo @adafruit @johnedgarpark #adafruit
2019-02-13Robotic Xylophone with Adafruit Grand Central #adafruit @adafruit
2019-02-133D Hangouts – Py, Bonnets and Stands
2019-02-12Pi Zero Stand #3dprinting #adafruit #raspberrypi
2019-02-12Lucky Cat and Lucky Pig with Circuit Playground Express #Adafruit @adafruit
2019-02-12Steven Universe -- Garnet's Gauntlets build @adafruit @johnedgarpark #adafruit #stevenuniverse
2019-02-11Print in Place Foldable Cube #3DPrinting #adafruit #timelapse @adafruit
2019-02-11Python on hardware preview - sign up!
2019-02-11CircuitPython Weekly - February 11, 2019 @adafruit @circuitpython #adafruit #circuitpython
2019-02-10E-Ink FEATHERwing preview @adafruit #adafruit #comingsoon
2019-02-10PyPortal - Python powered Iot device for displaying quotes @adafruit #adafruit #iot
2019-02-10PyPortal - Terminal head @adafruit #adafruit
2019-02-10Fusion 360 Tutorial – Parametric Angles
2019-02-09PyPortal - Tiny Bluetooth keyboard via Mu with CircuitPython "terminal" ... for a "PyPortal"
2019-02-08MakeCode Minute: Arcade Food + Backgrounds @adafruit @johnedgarpark #adafruit @MSMakeCode #makecode
2019-02-08CircuitPython powered "secondary display" for Mu (REPL) "hello world" @adafruit @CircuitPython
2019-02-08How to Use Video Greenscreen in MakeCode @adafruit @johnedgarpark #adafruit #makecode
2019-02-08Bluetooth Light Switch Feather nRF52840 demo @adafruit @johnedgarpark #adafruit #bluefruit
2019-02-07New Products 2/6/19 Featuring ADT7410 High Accuracy #I2C Temp Sensor Breakout! @adafruit #adafruit
2019-02-07JOHN PARK'S WORKSHOP LIVE 2/7/19 Bluetooth Light Switch @adafruit @johnedgarpark #adafruit
2019-02-07Maker Update: Clocking In [Maker Update Newsletter #111] @makerprojectlab @adafruit edition!



Tags:
adafruit
electronics
diy
arduino
hardware
opensource
projects
raspberry
pi
computer
raspberrypi
microcontrollers
limor
limorfried
ladyada
STEAM
STEM
python
microbit
circuitpython
neopixel
neopixels
raspberry pi
circuitplaygound
nyc
make
makers
micro:bit
adafrit
adafruit promo code
ada fruit
adafruit coupons
raspberry pi zero
micropython