• Skip to content

Main Menu

  • Home
  • Paintings
  • Interactive Work
  • About
  • Posts
  • Back
  • NM Women Series
  • Hollyhocks Series
  • Daily Paintings
  • Small Works
  • Back
  • Games and Toys
  • Ribbons
  • ORBS
Enrico Trujillo

Main Menu

  • Home
  • Paintings
    • NM Women Series
    • Hollyhocks Series
    • Daily Paintings
    • Small Works
  • Interactive Work
    • Games and Toys
    • Ribbons
    • ORBS
  • About
  • Posts
  • Search
  • 0 items

Pico Inky Pack Image Display

 Posted on on March 15, 2023

This bit of code displays a random image pulled from the internet on the screen of a Pico Inky Pack.

import board
import busio
import digitalio
import adafruit_requests as requests
import adafruit_inky
from adafruit_imageload import load_image, dither

# Set up the Inky display and buttons
inky_display = adafruit_inky.AutoDisplay()
button = digitalio.DigitalInOut(board.BUTTON_A)
button.direction = digitalio.Direction.INPUT
button.pull = digitalio.Pull.UP

# Set up the SPI bus and pins
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs_pin = digitalio.DigitalInOut(board.CE0)
dc_pin = digitalio.DigitalInOut(board.D22)
reset_pin = digitalio.DigitalInOut(board.D27)

# Initialize the Inky display
inky = adafruit_inky.InkyPHAT(spi, cs_pin, dc_pin, reset_pin, rotation=180)

# Get the image from picsum.photos
image_url = "https://picsum.photos/g/296/128"
response = requests.get(image_url)
image_file = response.content
image, palette = load_image(image_file)

# Dither the image
dither.dither_bitmask(image, bitmap=image)

# Display the dithered image on the Inky display
inky_display.display(inky, image)

# Wait for button press to exit
while button.value:
    pass

Posted in Uncategorized

Comments are closed.

Post navigation

Previous
Next

Primary

Recent Posts

  • Building an Art Store with WooCommerce: A Guide for Solo Artists
  • Egon Schiele⁣⁣ Portrait of the Painter Anton Peschka⁣⁣ 1909
  • Learning to Stretch My Paintings a Little Further
  • Growing Your Artist Footprint Online—Simple Steps I’m Taking (and You Can Too)
  • Choosing My Canvas: Why Format Matters When Painting People and Places

Archives

  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • August 2024
  • July 2024
  • April 2024
  • March 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • July 2022
  • March 2022
  • February 2022
  • December 2021
  • October 2021
  • August 2021

Categories

  • Advice
  • Agriculture
  • Art
  • Article
  • Business
  • Community
  • Culture
  • Daily
  • Drawing
  • Galleries
  • Home
  • Illustration
  • Land
  • News
  • Painting
  • Photography
  • Planning
  • Tech
  • Uncategorized

Follow us

Follow us on TwitterLike us on FacebookSubscribe to our Channel on YouTubeFollow us on GithubFollow us on InstagramFollow us on CodepenFollow us on SoundCloud

© Enrico Trujillo 2025MINIMAL

x