### Install Mote from GitHub Source: https://learn.pimoroni.com/article/getting-started-with-mote Manual installation by cloning the repository and running the setup script. ```bash git clone https://github.com/pimoroni/mote cd mote/python/library sudo python setup.py install ``` -------------------------------- ### Navigate to examples directory Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat Changes the current working directory to the location where Unicorn HAT examples are installed. ```bash cd ~/Pimoroni/unicornhat/examples/ ``` -------------------------------- ### List Available Examples Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Navigates to the examples directory and lists files. ```bash cd enviroplus-python cd examples ls ``` -------------------------------- ### Install BME680 using one-line installer Source: https://learn.pimoroni.com/article/getting-started-with-bme680-breakout Executes the automated installation script to set up the library and download examples to the home directory. ```bash curl https://get.pimoroni.com/bme680 | bash ``` -------------------------------- ### Run RetroPie Installation Script Source: https://learn.pimoroni.com/article/setting-up-picade-max Navigates to the setup directory and executes the installation script with root privileges. ```bash cd RetroPie-Setup sudo ./retropie_setup.sh ``` -------------------------------- ### Install Micro Dot pHAT Python library Source: https://learn.pimoroni.com/article/assembling-micro-dot-phat Use the one-line installer to set up the library and download example scripts. ```bash curl https://get.pimoroni.com/microdotphat | bash ``` -------------------------------- ### Install PyUSB from GitHub Source: https://learn.pimoroni.com/article/controlling-your-robot-wireless-keyboard Clone the PyUSB repository and install it using the setup script. ```bash git clone https://github.com/walac/pyusb cd pyusb sudo python setup.py install ``` -------------------------------- ### Install BME680 library from repository Source: https://learn.pimoroni.com/article/getting-started-with-bme680-breakout Clones the official repository and runs the installation script to set up the library and examples. ```bash git clone https://github.com/pimoroni/bme680-python cd bme680-python sudo ./install.sh ``` -------------------------------- ### Build SDK Examples Source: https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c%2B%2B Configures and compiles the example projects provided with the SDK. ```bash cd ~/picosystem/build cmake .. make ``` -------------------------------- ### Navigate to Examples Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat-mini Commands to access the directory containing the provided example scripts. ```bash cd ~/Pimoroni/unicornhatmini/examples ls ``` -------------------------------- ### Run Example Scripts Source: https://learn.pimoroni.com/article/getting-started-with-automation-hat-and-phat Commands to execute the provided example scripts. ```bash python3 output.py ``` ```bash python3 analog.py python3 input.py python3 relay.py ``` -------------------------------- ### Navigate to Example Directories Source: https://learn.pimoroni.com/article/getting-started-with-automation-hat-and-phat Commands to navigate to the HAT or HAT Mini example directories. ```bash cd ~/Pimoroni/automationhat/examples/hat/ ``` ```bash cd ~/Pimoroni/automationhat/examples/hat-mini/ ``` -------------------------------- ### Install Node.js and npm Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Finalize the installation of the compiled Node.js binaries. ```bash sudo make install ``` -------------------------------- ### Download and Install Library Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat-mini Commands to clone the repository and run the installation script. ```bash git clone https://github.com/pimoroni/unicornhatmini-python cd unicornhatmini-python sudo ./install.sh ``` -------------------------------- ### Run PiGlow Example Script Source: https://learn.pimoroni.com/article/setting-up-your-piglow Execute the cycle.py script to start the LED light animation. Use CTRL+C to stop the script. ```python python cycle.py ``` -------------------------------- ### Install Homebridge and plugin Source: https://learn.pimoroni.com/article/using-mote-with-homekit-and-siri Installs the Homebridge server and the HTTP-RGB plugin globally. ```bash sudo npm install -g --unsafe-perm homebridge sudo npm install -g --unsafe-perm homebridge-better-http-rgb ``` -------------------------------- ### Navigate to Inky wHAT examples Source: https://learn.pimoroni.com/article/getting-started-with-inky-what Change the current directory to the location of the wHAT-specific examples. ```bash cd ~/Pimoroni/inky/examples/what ``` -------------------------------- ### Navigate to the examples directory Source: https://learn.pimoroni.com/article/comics-on-inky-impression Use this command to access the directory containing the comic display examples. ```bash cd ~/Pimoroni/inky/examples/spectra6/comics ``` -------------------------------- ### Navigate to examples directory Source: https://learn.pimoroni.com/article/getting-started-with-explorer-hat Change the current directory to the location where Explorer HAT example scripts are stored. ```bash cd ~/Pimoroni/explorerhat ``` -------------------------------- ### Install Flask library Source: https://learn.pimoroni.com/article/using-mote-with-homekit-and-siri Install the Flask web framework using pip. ```bash sudo pip install flask ``` -------------------------------- ### Navigate to Display-o-Tron examples Source: https://learn.pimoroni.com/article/getting-started-with-display-o-tron Change the current directory to the location of the basic Display-o-Tron example scripts. ```bash cd ~/Pimoroni/displayotron/examples/basic ``` -------------------------------- ### Run the flash example script Source: https://learn.pimoroni.com/article/assembling-micro-dot-phat Navigate to the examples directory and execute the flash script to verify hardware functionality. ```bash cd /home/pi/Pimoroni/microdotphat/examples python flash.py ``` -------------------------------- ### Navigate to Examples Directory Source: https://learn.pimoroni.com/article/getting-started-with-inky-impression Changes the current directory to the location of the Spectra Inky examples. ```bash cd ~/Pimoroni/inky/examples/spectra6 ``` -------------------------------- ### Run the AirPlay installer Source: https://learn.pimoroni.com/article/streaming-airplay-to-your-pi Execute the Pimoroni AirPlay installer script via curl. ```bash curl https://get.pimoroni.com/airdac | bash ``` -------------------------------- ### Run Example Script Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat-mini Command to execute a specific Python example script. ```bash python3 demo.py ``` -------------------------------- ### Install Display-O-Tron Prerequisites Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Run the Pimoroni installation script to prepare the Raspberry Pi environment. ```bash curl https://get.pimoroni.com/displayotron | bash ``` -------------------------------- ### Run all-in-one sensor example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Executes the comprehensive example that displays data from all sensors on the LCD. Use the light/proximity sensor to toggle screens and press Ctrl+C to exit. ```bash python all-in-one.py ``` -------------------------------- ### Install BME680 library via pip Source: https://learn.pimoroni.com/article/getting-started-with-bme680-breakout Installs the library package using pip. Note that this method does not automatically download the example files. ```bash sudo pip install bme680 ``` -------------------------------- ### Install JVSDisplayOTron Dependency Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Install the module and save it to package.json. ```bash npm install jvsdisplayotron --save ``` ```text npm WARN package.json jvsdisplayotron_example@1.0.0 No repository field. npm WARN package.json jvsdisplayotron_example@1.0.0 No README data ``` -------------------------------- ### Install Enviro+ Software Source: https://learn.pimoroni.com/article/enviro-plus-and-luftdaten-air-quality-station Clones the repository and runs the installation script to configure necessary interfaces. ```bash git clone https://github.com/pimoroni/enviroplus-python cd enviroplus-python sudo ./install.sh ``` -------------------------------- ### Execute Spotify installer Source: https://learn.pimoroni.com/article/streaming-spotify-to-your-pi Run the Pimoroni Spotify installation script via curl. ```bash curl https://get.pimoroni.com/spotipy | bash ``` -------------------------------- ### Install Inky pHAT dependencies Source: https://learn.pimoroni.com/article/getting-started-with-inky-phat Run this command to install all necessary Python libraries and fonts required for the Inky pHAT examples. ```bash pip install pillow requests beautifulsoup4 fonts font-source-sans-pro font-source-serif-pro font-fredoka-one font-hanken-grotesk font-intuitive geocoder seaborn wikiquotes ``` -------------------------------- ### Run the simple example script Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat Executes the simple.py script to verify that the Unicorn HAT hardware is functioning correctly. ```bash sudo python ./simple.py ``` -------------------------------- ### Run Piano HAT Example Source: https://learn.pimoroni.com/article/build-an-itty-bitty-beat-box Executes the simple-piano.py example script to verify Piano HAT functionality. ```bash cd /home/pi/Pimoroni/pianohat/examples python simple-piano.py ``` -------------------------------- ### Install PICO-8 dependencies Source: https://learn.pimoroni.com/article/setting-up-picade Install the required SDL2 development library on the Raspberry Pi. ```bash sudo apt install libsdl2-dev ``` -------------------------------- ### Run 0.96" LCD example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Executes the Hello World script for the onboard LCD display. ```bash python lcd.py ``` -------------------------------- ### Install Flask and psutil Source: https://learn.pimoroni.com/article/raspberry-pi-system-stats-python Command to install the required Python libraries for the web service. ```bash sudo pip install psutil flask ``` -------------------------------- ### Start the Unicorn Paint application Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-paint Launches the paint.py script with root privileges. ```bash sudo ./paint.py ``` -------------------------------- ### Clone Raspberry Pi Pico examples Source: https://learn.pimoroni.com/article/pico-development-using-wsl Downloads the official Raspberry Pi Pico example repository. ```bash git clone -b master https://github.com/raspberrypi/pico-examples.git ``` -------------------------------- ### Install Picade Plasma software Source: https://learn.pimoroni.com/article/fitting-picade-plasma-buttons Use the one-line installer to set up the necessary software for the Plasma buttons. ```bash curl https://get.pimoroni.com/plasma | bash ``` -------------------------------- ### Install Explorer HAT software Source: https://learn.pimoroni.com/article/building-the-tiny-4wd Downloads and executes the installation script for the Explorer HAT/pHAT library. ```bash curl https://get.pimoroni.com/explorerhat | bash ``` -------------------------------- ### Install libusb-dev Source: https://learn.pimoroni.com/article/controlling-your-robot-wireless-keyboard Install the required libusb-dev dependency before setting up PyUSB. ```bash sudo apt-get install libusb-dev ``` -------------------------------- ### Install Automation HAT library Source: https://learn.pimoroni.com/article/getting-started-with-automation-hat-and-phat Commands to clone the repository and execute the installation script on a Raspberry Pi. ```bash git clone https://github.com/pimoroni/automation-hat cd automation-hat ./install.sh ``` -------------------------------- ### Run the BME680 example script Source: https://learn.pimoroni.com/article/getting-started-with-bme680-breakout Executes the provided example script to display continuous sensor readings. ```bash cd /home/pi/Pimoroni/bme680/examples python read-all.py ``` -------------------------------- ### Create main.py script Source: https://learn.pimoroni.com/article/micropython-on-esp-iot-phat Write a simple script to the filesystem to start the webREPL service automatically. ```python >>> main=open('main.py','w') >>> main.write('import webrepl\nwebrepl.start()') >>> main.close() ``` -------------------------------- ### Install alsaaudio library Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Installs the Python alsaaudio library required for audio processing. ```bash sudo apt-get install python-alsaaudio ``` -------------------------------- ### Install Trilobot Python Library Source: https://learn.pimoroni.com/article/assembling-trilobot Downloads the library from GitHub, navigates to the directory, and executes the installation script. ```bash git clone https://github.com/pimoroni/trilobot-python cd trilobot-python sudo ./install.sh ``` -------------------------------- ### Run the radio installer Source: https://learn.pimoroni.com/article/internet-radio-on-your-pirate-radio Downloads and executes the installation script for the pHAT BEAT radio software. ```bash curl https://get.pimoroni.com/vlcradio | bash ``` -------------------------------- ### Install inputs library Source: https://learn.pimoroni.com/article/building-the-tiny-4wd Installs the Python inputs library required for gamepad recognition. ```bash sudo pip install inputs ``` -------------------------------- ### Install Homebridge dependencies Source: https://learn.pimoroni.com/article/using-mote-with-homekit-and-siri Installs the required Avahi library for Homebridge discovery. ```bash sudo apt-get install libavahi-compat-libdnssd-dev ``` -------------------------------- ### Install Explorer Craft Library Source: https://learn.pimoroni.com/article/making-a-minecraft-thermometer Run this command in the terminal to install the required library for the Explorer HAT. ```bash sudo pip install explorercraft ``` -------------------------------- ### Install WSL Source: https://learn.pimoroni.com/article/pico-development-using-wsl Run this command in an administrator command prompt to install WSL and an Ubuntu distribution. ```bash wsl --install ``` -------------------------------- ### Install PicoSystem build tools Source: https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c%2B%2B Installs the required ARM cross-compilation toolchain and libraries on a Linux-based system. ```bash sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib ``` -------------------------------- ### Re-enable and start the background service Source: https://learn.pimoroni.com/article/getting-started-with-fan-shim Configures the service to start on boot and initiates it immediately. ```bash sudo systemctl enable pimoroni-fanshim.service sudo systemctl start pimoroni-fanshim.service ``` -------------------------------- ### Install pHAT BEAT software Source: https://learn.pimoroni.com/article/getting-started-with-phat-beat Use the one-line installer to set up the necessary software for the pHAT BEAT board. ```bash curl -sS get.pimoroni.com/phatbeat | bash ``` -------------------------------- ### Navigate to examples directory Source: https://learn.pimoroni.com/article/getting-started-with-inky-phat Changes the current working directory to the location where Inky examples are stored. ```bash cd ~/Pimoroni/inky/examples ``` -------------------------------- ### Install Schedule Library Source: https://learn.pimoroni.com/article/cute-alarm-clock Command to install the schedule library via pip. ```bash sudo pip install schedule ``` -------------------------------- ### Install Blinkt! software Source: https://learn.pimoroni.com/article/beginning-with-blinkt Executes the installation script for Blinkt! drivers. Requires an active internet connection. ```bash curl https://get.pimoroni.com/blinkt | bash ``` -------------------------------- ### Download RetroPie Setup Script Source: https://learn.pimoroni.com/article/setting-up-picade-max Clones the RetroPie-Setup repository from GitHub to the home directory. ```bash cd ~ git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git ``` -------------------------------- ### Install requests library Source: https://learn.pimoroni.com/article/getting-started-with-mote Command to install the requests library via terminal. ```bash sudo pip install requests ``` -------------------------------- ### Open pi-lluminate.py for Editing Source: https://learn.pimoroni.com/article/control-hue-with-envirophat Access the example script using the nano text editor on the Raspberry Pi. ```bash nano /home/pi/Pimoroni/enviro-phat/examples/advanced/pi-lluminate.py ``` -------------------------------- ### Configure software for Trinket programming Source: https://learn.pimoroni.com/article/raspberry-pi-programming-adafruit-trinket Use these commands to clone the repository and execute the setup script on Raspbian. ```bash git clone https://github.com/pimoroni/programming-trinket-with-raspberry-pi cd programming-trinket-with-raspberry-pi ./setup-raspbian ``` -------------------------------- ### Run Drum HAT Example Source: https://learn.pimoroni.com/article/build-an-itty-bitty-beat-box Executes the drums.py example script to verify Drum HAT functionality. ```bash cd /home/pi/Pimoroni/drumhat/examples python drums.py ``` -------------------------------- ### Run Luftdaten Script Source: https://learn.pimoroni.com/article/enviro-plus-and-luftdaten-air-quality-station Navigates to the examples directory and executes the Luftdaten monitoring script. ```bash cd enviroplus-python/examples python luftdaten.py ``` -------------------------------- ### Run Light and Proximity Example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Executes the script to display ambient light and proximity values. ```bash python light.py ``` -------------------------------- ### Install Speaker pHAT software Source: https://learn.pimoroni.com/article/say-anything-with-a-speaker-phat Use the one-line installer to set up the necessary drivers and software for the Speaker pHAT. ```bash curl -sS https://get.pimoroni.com/speakerphat | bash ``` -------------------------------- ### Install Unicorn HAT software Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat Executes the automated installation script for the Unicorn HAT library. ```bash curl https://get.pimoroni.com/unicornhat | bash ``` -------------------------------- ### Install Scroll pHAT library Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Executes the one-line installer script for Scroll pHAT configuration. ```bash curl https://get.pimoroni.com/scrollphat | bash ``` -------------------------------- ### Install Inky Library Source: https://learn.pimoroni.com/article/getting-started-with-inky-impression Clone the Inky repository and execute the installation script to set up the library and its dependencies. ```bash git clone https://github.com/pimoroni/inky cd inky ./install.sh ``` -------------------------------- ### Install VLC media player Source: https://learn.pimoroni.com/article/say-anything-with-a-speaker-phat Install the VLC package to handle audio playback on the Raspberry Pi. ```bash sudo apt-get install vlc ``` -------------------------------- ### Run the Adafruit IO Example Source: https://learn.pimoroni.com/article/getting-started-with-weather-hat Execute the script from the terminal to begin posting sensor data to the cloud. ```bash python adafruit-io.py ``` -------------------------------- ### Install Flask dependencies Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-paint Installs the Flask web framework required for the Unicorn Paint application. ```bash sudo apt-get install python-flask python3-flask ``` -------------------------------- ### Run a Python example script Source: https://learn.pimoroni.com/article/getting-started-with-explorer-hat Execute a specific Python example script using sudo privileges. ```bash sudo python drums.py ``` -------------------------------- ### Install Weather HAT Python library Source: https://learn.pimoroni.com/article/getting-started-with-weather-hat Commands to clone the repository and run the installation script on a Raspberry Pi. ```bash git clone https://github.com/pimoroni/weatherhat-python cd weatherhat-python ./install.sh ``` -------------------------------- ### Install Picade HAT Software Source: https://learn.pimoroni.com/article/assembling-your-picade-2018-edition Commands to clone the repository and run the installation script for joystick, button, audio, and power button configuration. ```bash git clone https://github.com/pimoroni/picade-hat cd picade-hat sudo ./install.sh ``` -------------------------------- ### Install the Fan SHIM Python library Source: https://learn.pimoroni.com/article/getting-started-with-fan-shim Clones the repository and runs the installation script to set up the library on the Raspberry Pi. ```bash git clone https://github.com/pimoroni/fanshim-python cd fanshim-python sudo ./install.sh ``` -------------------------------- ### Run Compensated Temperature Example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Executes the script that compensates for CPU heat. ```bash python compensated-temperature.py ``` -------------------------------- ### Install pHAT DAC drivers Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Executes the one-line installer script for pHAT DAC configuration. ```bash curl https://get.pimoroni.com/phatdac | bash ``` -------------------------------- ### Install Rainbow HAT software Source: https://learn.pimoroni.com/article/getting-started-with-rainbow-hat-in-python Executes the one-line installer script for the Rainbow HAT library in a terminal. ```bash curl https://get.pimoroni.com/rainbowhat | bash ``` -------------------------------- ### Compile and upload Blink sketch Source: https://learn.pimoroni.com/article/raspberry-pi-programming-adafruit-trinket Navigate to the example directory and trigger the upload process using make. ```bash cd examples/blink make upload ``` -------------------------------- ### Navigate to Trilobot examples directory Source: https://learn.pimoroni.com/article/assembling-trilobot Use this command to change the current working directory to the location where Trilobot examples are stored. ```bash cd ~/Pimoroni/trilobot/examples ``` -------------------------------- ### Upgrade Node.js and install npm Source: https://learn.pimoroni.com/article/using-mote-with-homekit-and-siri Updates the system and installs the latest version of Node.js and npm. ```bash sudo apt-get update sudo apt-get upgrade curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs npm ``` -------------------------------- ### Install Piano HAT library Source: https://learn.pimoroni.com/article/getting-started-with-piano-hat Run this command in the terminal to install all necessary prerequisites for Piano HAT. ```bash curl https://get.pimoroni.com/pianohat | bash ``` -------------------------------- ### Install Mote on Raspberry Pi Source: https://learn.pimoroni.com/article/getting-started-with-mote Use the one-line installer script to set up Mote software on Raspbian. ```bash curl https://get.pimoroni.com/mote | bash ``` -------------------------------- ### Install dependencies and clone repository Source: https://learn.pimoroni.com/article/controlling-ikea-tradfri-lights-from-your-pi Run these commands to install the necessary Python packages and download the IKEA TRÅDFRI control scripts. ```bash sudo apt-get install python-pip sudo pip install tqdm git clone https://github.com/sandyjmacdonald/ikea-smartlight cd ikea-smartlight ``` -------------------------------- ### Install Explorer HAT Software Source: https://learn.pimoroni.com/article/explorer-hat-pro-pin-entry-system Run these commands in the terminal to enable I2C, install dependencies, and set up the Python library. ```bash curl https://get.pimoroni.com/i2c | bash sudo apt-get install python-smbus sudo apt-get install python-pip sudo pip install explorerhat ``` -------------------------------- ### Install Enviro pHAT library via terminal Source: https://learn.pimoroni.com/article/controlling-ikea-tradfri-lights-from-your-pi Executes the one-line installer script to set up the Enviro pHAT library on your system. ```bash curl https://get.pimoroni.com/envirophat | bash ``` -------------------------------- ### Install Unicorn HAT software Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-phat Use the one-line installer to set up the Unicorn HAT Python library on Raspbian. ```bash curl https://get.pimoroni.com/unicornhat | bash ``` -------------------------------- ### Install Enviro pHAT software Source: https://learn.pimoroni.com/article/control-hue-with-envirophat Use the one-line installer to set up the necessary software for the Enviro pHAT on a Raspberry Pi. ```bash curl https://get.pimoroni.com/envirophat | bash ``` -------------------------------- ### Install PiGlow Libraries Source: https://learn.pimoroni.com/article/setting-up-your-piglow Run this command in the terminal to download and install the required PiGlow software libraries. ```bash curl https://get.pimoroni.com/piglow | bash ``` -------------------------------- ### Run Weather Sensor Example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Executes the weather sensor script to display temperature, pressure, and humidity. ```bash python weather.py ``` -------------------------------- ### Install Pirate Audio Software Source: https://learn.pimoroni.com/article/getting-started-with-pirate-audio Commands to clone the repository and execute the installation script on a Raspberry Pi. ```bash git clone https://github.com/pimoroni/pirate-audio cd pirate-audio/mopidy ./install.sh ``` -------------------------------- ### List files in directory Source: https://learn.pimoroni.com/article/getting-started-with-explorer-hat Display the contents of the current directory to see available examples. ```bash ls ``` -------------------------------- ### Install Touch pHAT software Source: https://learn.pimoroni.com/article/getting-started-with-touch-phat Use the one-line installer to set up the Touch pHAT library on your Raspberry Pi. ```bash curl https://get.pimoroni.com/touchphat | bash ``` -------------------------------- ### Initialize Python Shell and RPi.GPIO Source: https://learn.pimoroni.com/article/driving-a-seven-segment-digit Start the interactive Python shell and configure the GPIO mode. ```bash sudo python ``` ```python import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) ``` -------------------------------- ### Remove Installer Files Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat-mini Command to delete the cloned directory after installation is complete. ```bash sudo rm -r ~/unicornhatmini-python ``` -------------------------------- ### Install and run ffmpeg on Raspbian Stretch Source: https://learn.pimoroni.com/article/make-a-timelapse-with-octocam Use these commands to install ffmpeg via apt and generate a video from a sequence of images. ```bash sudo apt-get update sudo apt-get install ffmpeg ffmpeg -r 24 -pattern_type glob -i '*.jpg' -c:v copy output.avi ``` -------------------------------- ### Install PiCamera library Source: https://learn.pimoroni.com/article/make-a-timelapse-with-octocam Installs the Python 3 library required to interface with the Raspberry Pi camera module. ```bash sudo apt-get install python3-picamera ``` -------------------------------- ### Install smbus2 Dependency Source: https://learn.pimoroni.com/article/enviro-plus-and-luftdaten-air-quality-station Installs the smbus2 library required for the Luftdaten script. ```bash sudo pip install smbus2 ``` -------------------------------- ### Initialize LED Strip Source: https://learn.pimoroni.com/article/mqtt-remote-control Starts the LED strip controller and resets the LEDs. ```python led_strip.start() ``` -------------------------------- ### Install Git Source: https://learn.pimoroni.com/article/getting-started-with-inky-impression Install the git version control system, which may be required on Raspberry Pi OS Lite. ```bash sudo apt install git ``` -------------------------------- ### Initialize NPM Package Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Initialize a new npm project and create the entry point file. ```bash npm init ``` ```text name: (jvsdisplayotron_example) version: (1.0.0) description: JVSDisplayOTron Example entry point: (index.js) test command: git repository: keywords: author: license: (ISC) MIT ``` ```bash touch index.js ``` -------------------------------- ### Install Pico SDK dependencies Source: https://learn.pimoroni.com/article/pico-development-using-wsl Updates package lists and installs the required compiler toolchain and build tools for Pico development. ```bash sudo apt update sudo apt install git cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libstdc++-arm-none-eabi-newlib ``` -------------------------------- ### Install Four Letter pHAT software Source: https://learn.pimoroni.com/article/getting-started-with-four-letter-phat Use the one-line installer to set up the necessary software on your Raspberry Pi. ```bash curl https://get.pimoroni.com/fourletterphat | bash ``` -------------------------------- ### Install Mote via Pip Source: https://learn.pimoroni.com/article/getting-started-with-mote Standard installation method for Mote using pip on Mac, Linux, and Windows. ```bash sudo pip install mote ``` ```bash pip install mote ``` -------------------------------- ### Install and run ffmpeg on Raspbian Jessie Source: https://learn.pimoroni.com/article/make-a-timelapse-with-octocam Download and install the static binary for ffmpeg manually when using older OS versions. ```bash wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-armel-32bit-static.tar.xz tar -xJf ffmpeg-release-armel-32bit-static.tar.xz sudo cp ffmpeg-3.4.1-armel-32bit-static/ffmpeg /usr/local/bin ffmpeg -r 24 -pattern_type glob -i '*.jpg' -c:v copy output.avi ``` -------------------------------- ### Install ESP IoT pHAT software Source: https://learn.pimoroni.com/article/getting-started-with-iot-phat Executes the one-line installer script to configure the pHAT. A system reboot is required after running this command. ```bash curl https://get.pimoroni.com/iotphat | bash ``` -------------------------------- ### Install libcoap with DTLS support Source: https://learn.pimoroni.com/article/controlling-ikea-tradfri-lights-from-your-pi Commands to install dependencies, clone the libcoap repository, and compile the library with DTLS support enabled. ```bash sudo apt-get install build-essential autoconf automake libtool git clone --recursive https://github.com/obgm/libcoap.git cd libcoap git checkout dtls git submodule update --init --recursive ./autogen.sh ./configure --disable-documentation --disable-shared make sudo make install ``` -------------------------------- ### Run script with argument Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Example command to execute the script with a specific audio file. ```bash sudo python spectrum_analyser.py sailorshornpipe.wav ``` -------------------------------- ### Execute a Trilobot example script Source: https://learn.pimoroni.com/article/assembling-trilobot Run a specific Python example script using the python3 interpreter. ```bash python3 flash_underlights.py ``` -------------------------------- ### Setup PIL Canvas Source: https://learn.pimoroni.com/article/getting-started-with-inky-impression Imports necessary PIL modules and initializes a drawing canvas matching the display dimensions. ```python from PIL import Image, ImageFont, ImageDraw img = Image.new("P", (inky_display.width, inky_display.height), inky_display.WHITE) draw = ImageDraw.Draw(img) ``` -------------------------------- ### Start Flask Application Source: https://learn.pimoroni.com/article/simple-rgb-led-web-ui Runs the Flask server on all available network interfaces. ```python app.run(host='0.0.0.0') ``` -------------------------------- ### Install and Run Minicom Source: https://learn.pimoroni.com/article/getting-started-with-clipper-hat Installs the minicom terminal emulator and connects to the Clipper HAT via the appropriate serial device. ```bash sudo apt install minicom ``` ```bash minicom -b 115200 -D /dev/ttyAMA0 ``` ```bash minicom -b 115200 -D /dev/ttyS0 ``` -------------------------------- ### Install the dot3k library Source: https://learn.pimoroni.com/article/getting-started-with-display-o-tron Install the required dot3k library using pip to resolve module import errors. ```bash sudo pip install dot3k ``` -------------------------------- ### Setting up the display and drawing canvas Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Initializes the display hardware and creates a blank RGB image for drawing. ```python disp.begin() img = Image.new('RGB', (disp.width, disp.height), color=(0, 0, 0)) draw = ImageDraw.Draw(img) ``` -------------------------------- ### Install Python pip Source: https://learn.pimoroni.com/article/raspberry-pi-system-stats-python Command to install the Python package manager on a Raspberry Pi. ```bash sudo apt-get install python-pip ``` -------------------------------- ### Initialize Unicorn HAT Mini Source: https://learn.pimoroni.com/article/getting-started-with-unicorn-hat-mini Import the library and create an instance to control the HAT. ```python from unicornhatmini import UnicornHATMini uh = UnicornHATMini() ``` -------------------------------- ### Setting Up and Starting IR Receiver Source: https://learn.pimoroni.com/article/lights-n-sound-with-tiny-fx-w-and-infrared Configures the IR receiver hardware and begins signal processing. ```python receiver = NECRemoteReceiver(TinyFX.SENSOR_PIN, 1, 0) receiver.bind(remote) try: receiver.start() ``` -------------------------------- ### Start webREPL Source: https://learn.pimoroni.com/article/micropython-on-esp-iot-phat Initializes the webREPL daemon to allow interactive shell access over WebSockets. ```python >>> import webrepl >>> webrepl.start() ``` -------------------------------- ### Configure Keybow MINI Source: https://learn.pimoroni.com/article/setting-up-the-keybow-os Add this setup function after requiring the keybow library when using the MINI variant. ```lua function setup() keybow.use_mini() end ``` -------------------------------- ### Install GCC 4.9 Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Install specific versions of GCC and G++ required for compilation. ```bash sudo apt-get install gcc-4.9 g++-4.9 ``` -------------------------------- ### Initialize global matrix and data array Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Sets up the global matrix and converts binary audio data into a NumPy array. ```python global matrix data = unpack("%dh" % (len(data) / 2), data) data = np.array(data, dtype='h') ``` -------------------------------- ### Run the weather example Source: https://learn.pimoroni.com/article/getting-started-with-inky-phat Execute the weather script from the terminal, specifying the display color. ```bash python weather-phat.py --colour "red" ``` -------------------------------- ### Remove Installation Directory Source: https://learn.pimoroni.com/article/assembling-trilobot Deletes the cloned repository folder after the installation process is complete. ```bash sudo rm -r ~/trilobot-python/ ``` -------------------------------- ### Enable and Test PPP Connection Source: https://learn.pimoroni.com/article/getting-started-with-clipper-hat Commands to start the PPP connection and verify internet connectivity via the ppp0 interface. ```bash sudo pon clipper ``` ```bash ping -I ppp0 1.1.1.1 ``` -------------------------------- ### Run the calendar example Source: https://learn.pimoroni.com/article/getting-started-with-inky-phat Execute the calendar script from the terminal, specifying the display color. ```bash cd phat python calendar-phat.py --colour "red" ``` -------------------------------- ### Install Explorer HAT library fork Source: https://learn.pimoroni.com/article/explorer-hat-pro-shift-register Commands to install the necessary dependencies and the custom fork of the Explorer HAT library containing the ShiftRegister class. ```bash curl https://get.pimoroni.com/i2c | bash sudo apt-get install python-smbus git clone https://github.com/sandyjmacdonald/explorer-hat.git cd explorer-hat/library sudo python setup.py install ``` -------------------------------- ### Run Stripes Example Source: https://learn.pimoroni.com/article/getting-started-with-inky-impression Executes the stripes.py script to display available colors on the Inky screen. ```bash python stripes.py ``` -------------------------------- ### Install OpenCV Dependencies Source: https://learn.pimoroni.com/article/building-a-pan-tilt-face-tracker Install the necessary OpenCV libraries and Python SMBus support required for face recognition. ```bash sudo apt-get install python-smbus python-opencv opencv-data ``` -------------------------------- ### Install Pimoroni HAT Software Source: https://learn.pimoroni.com/article/build-an-itty-bitty-beat-box One-line installers for Speaker pHAT, Piano HAT, and Drum HAT software. Requires terminal access and may prompt for a reboot. ```bash curl https://get.pimoroni.com/speakerphat | bash ``` ```bash curl https://get.pimoroni.com/pianohat | bash ``` ```bash curl https://get.pimoroni.com/drumhat | bash ``` -------------------------------- ### Example status output Source: https://learn.pimoroni.com/article/controlling-ikea-tradfri-lights-from-your-pi Sample output showing bulb and group information retrieved from the gateway. ```text bulbid 65538, name: TRADFRI bulb E27 WS opal 980lm 2, bightness: 245, state: off bulbid 65537, name: TRADFRI bulb E27 WS opal 980lm, bightness: 254, state: off groupid: 155563, name: TRADFRI GROUP, state: off ``` -------------------------------- ### Initialize Wi-Fi Interface Source: https://learn.pimoroni.com/article/mqtt-remote-control Creates and activates the Wi-Fi station interface. ```python wlan = network.WLAN(network.STA_IF) wlan.active(True) ``` -------------------------------- ### View particulate sensor output example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Example output showing PM1.0, PM2.5, and PM10 concentrations along with particle counts per 0.1L of air. ```text PM1.0 ug/m3 (ultrafine particles): 2 PM2.5 ug/m3 (combustion particles, organic compounds, metals): 3 PM10 ug/m3 (dust, pollen, mould spores): 4 PM1.0 ug/m3 (atmos env): 2 PM2.5 ug/m3 (atmos env): 3 PM10 ug/m3 (atmos env): 4 >0.3um in 0.1L air: 663 >0.5um in 0.1L air: 168 >1.0um in 0.1L air: 24 >2.5um in 0.1L air: 2 >5.0um in 0.1L air: 0 >10um in 0.1L air: 0 ``` -------------------------------- ### Start Mote API Source: https://learn.pimoroni.com/article/using-mote-with-homekit-and-siri Executes the Mote API script to begin listening for requests. ```bash python /home/pi/mote_api.py ``` -------------------------------- ### Light and Proximity Output Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Example output from the light and proximity sensor script. ```text Light: 1497.45 Lux Proximity: 00.00 ``` -------------------------------- ### Open MicroPython REPL Source: https://learn.pimoroni.com/article/alternative-badgeware-workflows Starts an interactive Python shell session on the connected device. ```bash mpremote repl ``` -------------------------------- ### Download Boilerplate Project Source: https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c%2B%2B Clones the boilerplate template repository to start a new project. ```bash git clone https://github.com/pimoroni/picosystem-boilerplate.git ~/ourproject cd ~/ourproject ``` -------------------------------- ### Initialize Inky wHAT display Source: https://learn.pimoroni.com/article/getting-started-with-inky-what Use the auto-detection boilerplate for most setups, or the manual InkyWHAT class if EEPROM detection fails. ```python from inky.auto import auto inky_display = auto() inky_display.set_border(inky_display.WHITE) ``` ```python from inky import InkyWHAT inky_display = InkyWHAT("red") inky_display.set_border(inky_display.WHITE) ``` -------------------------------- ### Cheerlights API JSON response example Source: https://learn.pimoroni.com/article/getting-started-with-mote Example of the JSON structure returned by the Cheerlights API. ```json {"created_at":"2016-09-06T17:31:02Z","entry_id":127729,"field2":"#800080"} ``` -------------------------------- ### Main loop entry Source: https://learn.pimoroni.com/article/spoke-media-controller Starts the continuous execution loop. ```python while True: ``` -------------------------------- ### Create Project Directory Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Set up the directory structure for the Node.js application. ```bash cd ~ && mkdir node_apps && cd node_apps ``` ```bash mkdir jvsdisplayotron_example && cd jvsdisplayotron_example ``` -------------------------------- ### Launch Python IDE as Root Source: https://learn.pimoroni.com/article/making-a-minecraft-thermometer Start the Python IDE with superuser privileges to ensure proper hardware access. ```bash sudo idle ``` -------------------------------- ### Bitwise right shift example Source: https://learn.pimoroni.com/article/driving-a-seven-segment-digit Demonstrates shifting bits to the right. ```python 0b100000100 >> 1 = 0b01000010 ``` -------------------------------- ### Run the quotes example Source: https://learn.pimoroni.com/article/getting-started-with-inky-what Execute the quotes script with a specified display color. ```bash python quotes-what.py --colour "red" ``` -------------------------------- ### Manage animation patterns Source: https://learn.pimoroni.com/article/fitting-picade-plasma-buttons Commands to list, switch, and install custom animation patterns for the buttons. ```bash plasmactl --list ``` ```bash plasmactl rainbow-cycle ``` ```bash plasmactl --install my-animation.png ``` ```bash plasmactl my-animation ``` -------------------------------- ### Run name badge example Source: https://learn.pimoroni.com/article/getting-started-with-inky-phat Executes the name badge script with specific display type, color, and name arguments. ```bash python name-badge.py --type "auto" --colour "red" --name "Inigo Montoya" ``` -------------------------------- ### Initialize RPi.GPIO Source: https://learn.pimoroni.com/article/driving-a-seven-segment-four-digit-display Set up the GPIO library to use BCM pin numbering. ```python import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) ``` -------------------------------- ### Initialize Blinkt! library Source: https://learn.pimoroni.com/article/getting-started-with-blinkt Import necessary functions and set the global brightness level. ```python from blinkt import set_pixel, set_brightness, show, clear set_brightness(0.1) ``` -------------------------------- ### Implement Release-Based Key Mapping Source: https://learn.pimoroni.com/article/setting-up-the-keybow-os Example of triggering different actions on key press and release by using the pressed state. ```lua function handle_key_00(pressed) keybow.set_key("0", pressed) keybow.set_key("1", not pressed) end ``` -------------------------------- ### Enable Mopidy Service Linger Source: https://learn.pimoroni.com/article/getting-started-with-pirate-audio Command to ensure the Mopidy service starts automatically on boot. ```bash sudo loginctl enable-linger ``` -------------------------------- ### Test Scroll pHAT functionality Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Runs the CPU usage example script to verify the Scroll pHAT display. ```bash sudo python scroll-phat/examples/cpu.py ``` -------------------------------- ### Run MICS6814 gas sensor example Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Executes the gas sensor script. Note that the sensor requires a warm-up period of at least 10 minutes for stable readings. ```bash python gas.py ``` -------------------------------- ### Start interactive Python shell Source: https://learn.pimoroni.com/article/getting-started-with-explorer-hat Launch the Python interpreter with root privileges required for hardware access. ```bash sudo python ``` -------------------------------- ### Initialize Presto Hardware Source: https://learn.pimoroni.com/article/build-a-presto-newsfeed-app Creates the main Presto instance and enables ambient LED lighting. ```python presto = Presto() presto.auto_ambient_leds(True) ``` -------------------------------- ### Run BME280 Sensor Examples Source: https://learn.pimoroni.com/article/getting-started-with-weather-hat Commands to execute the basic and compensated BME280 sensor reading scripts. ```bash python BME280.py ``` ```bash python BME280-compensated.py ``` -------------------------------- ### Define the main execution block Source: https://learn.pimoroni.com/article/using-mote-with-homekit-and-siri Initializes the Mote state to off and starts the Flask development server. ```python if __name__ == '__main__': mote_off() app.run(host='0.0.0.0', debug=True) ``` -------------------------------- ### Prepare build directory Source: https://learn.pimoroni.com/article/pico-development-using-wsl Navigates to the project directory and creates a dedicated build folder. ```bash cd ~/pico/pico-examples mkdir build cd build ``` -------------------------------- ### Configure automatic playback on boot Source: https://learn.pimoroni.com/article/say-anything-with-a-speaker-phat Add a command to the crontab to launch the VLC playlist automatically when the system starts. ```bash crontab -e ``` ```bash @reboot cvlc mixtape.xspf & ``` -------------------------------- ### Initialize MQTT Client Source: https://learn.pimoroni.com/article/rgb-led-doorbell-with-home-assistant Creates the main function to initialize the MQTT client with the specified configuration. ```python def main(): client = MQTTClient( client_id=CLIENT_ID, server=MQTT_BROKER, port=MQTT_PORT, user=MQTT_USERNAME, password=MQTT_PASSWORD, ) ``` -------------------------------- ### Read Buttons and Control RGB LED Source: https://learn.pimoroni.com/article/getting-started-with-interstate-75 Example implementation for reading user buttons and setting the onboard RGB LED color, requiring adafruit_rgbled and simpleio libraries. ```python import board import digitalio import adafruit_rgbled import busio button_boot = digitalio.DigitalInOut(board.USER_SW) button_boot.direction = digitalio.Direction.INPUT button_boot.pull = digitalio.Pull.UP button_a = digitalio.DigitalInOut(board.SW_A) button_a.direction = digitalio.Direction.INPUT button_a.pull = digitalio.Pull.UP led = adafruit_rgbled.RGBLED(board.LED_R, board.LED_G, board.LED_B, invert_pwm = True) def button_read(button): return not button.value while True: if button_read(button_a): led.color = (0, 255, 0) if button_read(button_boot): led.color = (0, 0, 255) ``` ```python import board import digitalio import adafruit_rgbled import busio button_a = digitalio.DigitalInOut(board.GP14) button_a.direction = digitalio.Direction.INPUT button_a.pull = digitalio.Pull.UP button_b = digitalio.DigitalInOut(board.GP15) button_b.direction = digitalio.Direction.INPUT button_b.pull = digitalio.Pull.UP led = adafruit_rgbled.RGBLED(board.GP16, board.GP17, board.GP18, invert_pwm = True) def button_read(button): return not button.value while True: if button_read(button_a): led.color = (0, 255, 0) if button_read(button_b): led.color = (0, 0, 255) ``` -------------------------------- ### Install the automatic fan control service Source: https://learn.pimoroni.com/article/getting-started-with-fan-shim Configures the background service with specific temperature thresholds and polling delays. ```bash cd examples sudo ./install-service.sh --on-threshold 65 --off-threshold 55 --delay 2 ``` -------------------------------- ### Run the Python application Source: https://learn.pimoroni.com/article/simple-rgb-led-web-ui Command to execute the RGB LED control script with root privileges. ```bash sudo python rgb.py ``` -------------------------------- ### Manually configure LED colors in setup Source: https://learn.pimoroni.com/article/setting-up-the-keybow-os Disables automatic lighting and sets specific RGB values for each LED pixel during initialization. ```lua function setup() -- Set custom lights up keybow.auto_lights(false) keybow.clear_lights() keybow.set_pixel(0, 255, 255, 0) -- Green keybow.set_pixel(1, 255, 255, 0) -- Green keybow.set_pixel(2, 0, 255, 255) -- Cyan keybow.set_pixel(3, 255, 0, 255) -- Magenta keybow.set_pixel(4, 0, 255, 255) -- Cyan keybow.set_pixel(5, 0, 255, 255) -- Cyan keybow.set_pixel(6, 255, 0, 255) -- Magenta keybow.set_pixel(7, 255, 0, 255) -- Magenta keybow.set_pixel(8, 0, 255, 255) -- Cyan keybow.set_pixel(9, 255, 0, 255) -- Magenta keybow.set_pixel(10, 0, 255, 255) -- Cyan keybow.set_pixel(11, 0, 255, 255) -- Cyan end ``` -------------------------------- ### Run Image Example Source: https://learn.pimoroni.com/article/getting-started-with-inky-impression Displays a JPEG image on the Inky Impression display using the image.py script with specific file arguments. ```bash python image.py --file images/shipping-picture-inky7.jpg ``` ```bash python image.py --file images/vincent-van-gogh-inky13.jpg ``` ```bash python image.py --file ~/Pimoroni/inky/examples/spectra6/images/shipping-picture-inky7.jpg ``` -------------------------------- ### Run ShiftRegister demo Source: https://learn.pimoroni.com/article/explorer-hat-pro-shift-register Python code to initialize the ShiftRegister plugin and execute a built-in LED demonstration sequence. ```python from explorerhat import plugins shiftreg = plugins.ShiftRegister() shiftreg.demo() ``` -------------------------------- ### Importing Required Modules Source: https://learn.pimoroni.com/article/lights-n-sound-with-tiny-fx-w-and-infrared Initializes the necessary libraries for Tiny FX W, audio playback, and IR remote communication. ```python import time from tiny_fx import TinyFX from picofx import MonoPlayer from aye_arr.nec import NECRemoteReceiver from aye_arr.nec.remotes import PimoroniRemote ``` -------------------------------- ### Download PicoSystem SDK Source: https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c%2B%2B Clones the official PicoSystem SDK repository to the home directory. ```bash git clone https://github.com/pimoroni/picosystem.git ~/picosystem ``` -------------------------------- ### Execute AT Hello World Command Source: https://learn.pimoroni.com/article/getting-started-with-iot-phat Verifies communication with the ESP module by sending the basic AT command. ```text AT ``` -------------------------------- ### Install mpremote via pip Source: https://learn.pimoroni.com/article/alternative-badgeware-workflows Installs the mpremote tool globally using Python's package manager. ```bash pip install mpremote ``` -------------------------------- ### Initializing TinyFX Source: https://learn.pimoroni.com/article/what-is-tinyfx Create an instance of the TinyFX class to control the hardware. ```python tiny = TinyFX() ``` -------------------------------- ### Initialize Display-O-Tron in Node.js Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Load the module and initialize the specific hardware model. ```javascript // Load the JVSDisplayOTron module. var JVSDisplayOTron = require('jvsdisplayotron'); ``` ```javascript // Initialize the Display-O-Tron 3000. var dot3k = new JVSDisplayOTron.DOT3k(); ``` ```javascript // Initialize the Display-o-Tron HAT. var dothat = new JVSDisplayOTron.DOTHAT(); ``` -------------------------------- ### Initializing TinyFX Object Source: https://learn.pimoroni.com/article/lights-n-sound-with-tiny-fx-w-and-infrared Creates the main TinyFX instance and specifies the root directory for audio files. ```python tiny = TinyFX(wav_root="/falcon") ``` -------------------------------- ### Build Custom Project Source: https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c%2B%2B Creates a build directory and compiles the custom project. ```bash mkdir ~/ourproject/build cd ~/ourproject/build cmake .. make ``` -------------------------------- ### Import required modules Source: https://learn.pimoroni.com/article/rgb-led-doorbell-with-home-assistant Load necessary libraries for hardware control, networking, audio, and MQTT communication. ```python from stellar import StellarUnicorn from picographics import PicoGraphics, DISPLAY_STELLAR_UNICORN from umqtt.simple import MQTTClient import time import network from audio import WavPlayer import secrets ``` -------------------------------- ### Install Scroll pHAT HD library Source: https://learn.pimoroni.com/article/getting-started-with-scroll-phat-hd Use the one-line installer to set up the Scroll pHAT HD Python library on your Raspberry Pi. ```bash curl https://get.pimoroni.com/scrollphathd | bash ``` -------------------------------- ### Initialize GPIO Pins Source: https://learn.pimoroni.com/article/dot-breakout-usage-pi Sets up the BCM pin numbering and configures pins 5, 6, and 13 as outputs for the RGB LEDs. ```python import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(5, GPIO.OUT) GPIO.setup(6, GPIO.OUT) GPIO.setup(13, GPIO.OUT) ``` -------------------------------- ### Create the Python script file Source: https://learn.pimoroni.com/article/controlling-ikea-tradfri-lights-from-your-pi Command to initialize the script file in the project directory. ```bash nano tradfri-envirophat.py ``` -------------------------------- ### Initialize data structures Source: https://learn.pimoroni.com/article/scroll-phat-spectrum-analyser Defines lists for storing audio power values, display matrix, and frequency band weightings. ```python matrix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] power = [] weighting = [1, 1, 2, 4, 8, 8, 8, 8, 16, 16, 16] ``` -------------------------------- ### battery() Source: https://learn.pimoroni.com/article/picosystem-api-cheatsheet Gets the current battery level. ```APIDOC ## battery() ### Description Returns the current battery level as a number between 0 and 100. ``` -------------------------------- ### Full Flask LED Control Server Source: https://learn.pimoroni.com/article/simple-rgb-led-web-ui A complete script to initialize GPIO and define URL routes for toggling a red LED. ```python LED_RED = 22 from flask import Flask import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(LED_RED, GPIO.OUT) app = Flask(__name__) @app.route("/led/red/on") def turn_red_led_on(): GPIO.output(LED_RED, 1) return 'LED On: red' @app.route("/led/red/off") def turn_red_led_off(): GPIO.output(LED_RED, 0) return 'LED Off: red' app.run(host='0.0.0.0') ``` -------------------------------- ### Weather Sensor Output Source: https://learn.pimoroni.com/article/getting-started-with-enviro-plus Example output from the weather sensor script. ```text Temperature: 23.35 *C Pressure: 996.36 hPa Relative humidity: 39.70 % ``` -------------------------------- ### Download the Pico SDK Source: https://learn.pimoroni.com/article/getting-started-with-picosystem-and-c%2B%2B Clones the official Raspberry Pi Pico SDK repository to the home directory. ```bash git clone https://github.com/raspberrypi/pico-sdk.git ~/pico-sdk ``` -------------------------------- ### Get display dimensions Source: https://learn.pimoroni.com/article/getting-started-with-explorer Retrieves the width and height of the display in pixels. ```python WIDTH, HEIGHT = display.get_bounds() ``` -------------------------------- ### Initialize NeoPixels and Colors Source: https://learn.pimoroni.com/article/spoke-media-controller Sets up the NeoPixel strip with specific brightness and defines color constants. ```python num_pixels = 27 pixels = neopixel.NeoPixel(board.GP0, num_pixels, brightness=0.05, auto_write=True) red = (255,0,0) green = (0,255,0) off = (0,0,0) ``` -------------------------------- ### Reboot Raspberry Pi Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Reboot the system to apply changes after installing prerequisites. ```bash sudo reboot ``` -------------------------------- ### BME280 Sensor Output Source: https://learn.pimoroni.com/article/getting-started-with-weather-hat Example output format from the BME280 sensor script. ```text Device temperature: 27.28 *C Humidity: 27.76 % Pressure: 1023.89 hPa ``` -------------------------------- ### Initialize Inky pHAT display Source: https://learn.pimoroni.com/article/getting-started-with-inky-phat Use these snippets to set up the display connection. The auto-detect method is recommended, while the manual method is a fallback for older hardware. ```python from inky.auto import auto inky_display = auto() inky_display.set_border(inky_display.WHITE) ``` ```python from inky import InkyPHAT inky_display = InkyPHAT("red") inky_display.set_border(inky_display.WHITE) ``` -------------------------------- ### Importing Required Modules Source: https://learn.pimoroni.com/article/getting-started-with-enviro-phat Initializes the time module and necessary Enviro pHAT sensor libraries. ```python import time from envirophat import light, motion, weather, leds ``` -------------------------------- ### Initialize display objects Source: https://learn.pimoroni.com/article/rgb-led-doorbell-with-home-assistant Create graphics and hardware interface objects for the Stellar Unicorn matrix. ```python graphics = PicoGraphics(display=DISPLAY_STELLAR_UNICORN) su = StellarUnicorn() ``` -------------------------------- ### Configure Wi-Fi network settings Source: https://learn.pimoroni.com/article/motioneye-os-on-your-octocam Create this file as wpa_supplicant.conf in the boot partition of the SD card to connect to a network on boot. ```text country=GB ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ scan_ssid=1 ssid="MyWiFiNetwork" psk="password123" } ``` -------------------------------- ### Clear Mote strips Source: https://learn.pimoroni.com/article/getting-started-with-mote Resets the Mote strips before starting the main loop. ```python mote.clear() mote.show() ``` -------------------------------- ### Update System Packages Source: https://learn.pimoroni.com/article/controlling-display-o-tron-with-node-js Refresh the package list and upgrade installed software on Raspbian. ```bash sudo apt-get update && sudo apt-get upgrade ``` -------------------------------- ### Configure MQTT Client Source: https://learn.pimoroni.com/article/mqtt-remote-control Sets up the MQTT client connection parameters using broker details and client ID. ```python client = MQTTClient( client_id=CLIENT_ID, server=MQTT_BROKER, port=MQTT_PORT ) ``` -------------------------------- ### Create Pico project directory Source: https://learn.pimoroni.com/article/pico-development-using-wsl Sets up a dedicated workspace directory in the home folder for Pico-related projects. ```bash cd ~/ mkdir pico cd pico ``` -------------------------------- ### Basic HTML interface Source: https://learn.pimoroni.com/article/simple-rgb-led-web-ui A simple HTML file providing direct links to control the LED state. ```html