element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Ralph Yamamoto's Blog Adafruit FunHouse Slideshow using PIR
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 18 May 2021 3:35 PM Date Created
  • Views 873 views
  • Likes 2 likes
  • Comments 0 comments
  • adafruit slideshow
  • adafruit funhouse
  • circuitpython
  • tft display
  • esp32-s2_wrover
Related
Recommended

Adafruit FunHouse Slideshow using PIR

ralphjy
ralphjy
18 May 2021

I recently started using an Adafruit FunHouse with CircuitPython Adafruit FunHouse and did a quick project for Mother's Day and my wife's birthday Adafruit FunHouse - Happy Mother's Day .  When I did the Mother's Day project I had wanted to have pictures and sound, but did not get that part finished in time.  I discovered later that the compiled slideshow library adafruit_slideshow.mpy was available for CircuitPython v6, I had just missed seeing it.

 

So, I decided to give it a try.  In this demo, I'm going to use the PIR sensor to advance through the pictures.  The NeoPixels start out Red and when motion is detected by the PIR, they switch to Green and the next picture is loaded.

 

Here is the code:

slideshow_pir.py

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

"""Basic demonstration script will create a slideshow
object that plays through once alphabetically."""
import board
import pulseio
import touchio
from digitalio import DigitalInOut, Direction, Pull
from adafruit_funhouse import FunHouse
from adafruit_slideshow import PlayBackOrder, SlideShow, PlayBackDirection

# use built in display (PyPortal, PyGamer, PyBadge, CLUE, etc.)
# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.)
# https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus
display = board.DISPLAY

# pylint: disable=no-member

funhouse = FunHouse(
    default_bg=0x0F0F00,
    scale=2,
)

# funhouse.peripherals.set_dotstars(0x800000, 0x808000, 0x008000, 0x000080, 0x800080)
funhouse.peripherals.set_dotstars(0x200000, 0x200000, 0x200000, 0x200000, 0x200000)

slideshow = SlideShow(
    board.DISPLAY,
    pulseio.PWMOut(board.TFT_BACKLIGHT),
    folder="/images/",
    auto_advance=False,
    # order=PlayBackOrder.ALPHABETICAL,
    dwell=0,
)

while True:
    if funhouse.peripherals.pir_sensor:
        funhouse.peripherals.set_dotstars(0x002000, 0x002000, 0x002000, 0x002000, 0x002000)
        slideshow.direction = PlayBackDirection.FORWARD
        slideshow.advance()
    else:
        funhouse.peripherals.set_dotstars(0x200000, 0x200000, 0x200000, 0x200000, 0x200000)

 

 

Demo Video - apologies for the background fan noise, I forgot to mute the audio.  I'm out of the frame, but I'm moving in the background to advance the pictures.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

I was surprised at how long the images took to load - seems about 5-6 seconds.

 

The other issue with this type of application using CircuitPython on the FunHouse is that I don't end up with much file storage space for pictures.  The FunHouse has a 4MB Flash memory, but with CircuitPython loaded there is only about 1 MB left free for applications.

image

 

And each 240x240 bmp image takes 169KB, so I can only load a few images.

image

 

I'll need to look at adding external storage or maybe switch to programming it with the Arduino IDE.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube