Update:
sudo apt update && sudo apt upgrade
Enable SPI:
sudo raspi-config > Interface options
Set permissions:
Update:
sudo apt update && sudo apt upgrade
Enable SPI:
sudo raspi-config > Interface options
Set permissions:
| """ | |
| Clipper HAT's reset pin can be pulled low to reset the module. Using Python, that could look like this: | |
| """ | |
| import RPi.GPIO as GPIO | |
| import time | |
| GPIO.setmode(GPIO.BOARD) | |
| GPIO.setup(24, GPIO.OUT) |
| """ | |
| Python script to fetch a randomised comic cover from the Comic Vine API and show it on an Inky Impression display. | |
| You will need to sign up for an API key at https://comicvine.gamespot.com/api/ to use this script. | |
| Change the search query to the comic series you want to display! | |
| """ | |
| import json | |
| import random | |
| import time | |
| from io import BytesIO |
| full_battery = 4.2 | |
| empty_battery = 2.8 | |
| def get_vsys(): | |
| # Pico W voltage read function by darconeous on reddit: | |
| # https://www.reddit.com/r/raspberrypipico/comments/xalach/comment/ipigfzu/ | |
| conversion_factor = 3 * 3.3 / 65535 | |
| import network | |
| from machine import Pin, ADC | |
| wlan = network.WLAN(network.STA_IF) |
I started from the most recent version of Raspberry Pi OS (with recommended software) on a Pi Zero 2 W.
First install the repackaged installer from pimoroni/pirate-audio#105. This is now merged into main so you can install it with
git clone https://github.com/pimoroni/pirate-audio
cd pirate-audio/mopidy
./install.sh| # Resize a gif and convert it to a series of PNG files using PIL (pip install pillow) | |
| # Run it like this: python convert_gifs.py mygif.gif mygif | |
| import sys | |
| from PIL import Image, ImageSequence | |
| import os | |
| # make a new directory for the files | |
| try: | |
| os.mkdir(sys.argv[2]) |
| def get_vsys(): | |
| # Pico W voltage read function by darconeous on reddit: | |
| # https://www.reddit.com/r/raspberrypipico/comments/xalach/comment/ipigfzu/ | |
| conversion_factor = 3 * 3.3 / 65535 | |
| import network | |
| from machine import Pin, ADC | |
| wlan = network.WLAN(network.STA_IF) | |
| wlan_active = wlan.active() | |
| try: |
| import plasma | |
| from plasma import plasma2040 | |
| import time | |
| # Random functions! We'll be using randrange for picking integers from a range, and uniform for floats. | |
| from random import randrange, uniform | |
| from pimoroni import RGBLED, Button | |
| from machine import Pin | |
| led = RGBLED(plasma2040.LED_R, plasma2040.LED_G, plasma2040.LED_B) | |
| led.set_rgb(0, 0, 0) |
| import machine | |
| sda=machine.Pin(4) | |
| scl=machine.Pin(5) | |
| i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000) | |
| print('Scan i2c bus...') | |
| devices = i2c.scan() | |
| if len(devices) == 0: | |
| print("No i2c device !") |
| """ | |
| This example connects to the Carbon Intensity API to give you a regional forecast of how | |
| your (UK) electricity is being generated and its carbon impact. | |
| Carbon Intensity API only reports data from the UK National Grid. | |
| Find out more about what the numbers mean at: | |
| https://carbonintensity.org.uk/ | |
| Make sure to uncomment the correct size for your display! |