Skip to main content

A Python framework for building applications on all Raspberry Pi versions, including Pico.

Project description

RPi App Framework Modular framework for all Raspberry Pi models (Pico 2 W with MicroPython/Thonny, full RPi 1-5 with Python). Installation For MicroPython/Pico (Thonny):

Copy the rpi_app_framework folder to /lib on your Pico.

For full Python/RPi:

pip install rpi-app-framework

Usage Create a main.py to start your app:

examples/simple_demo.py

from rpi_app_framework import RPIApp, PiHardwareAdapter import time

class SimpleDemo(RPIApp): """ Minimal demo that shows: • Board model detection • CPU temperature monitoring • On-board LED blinking Works on Pico 2 W and all full-size Raspberry Pi models. """

def setup(self):
    # Initialise the hardware adapter
    self.hw = PiHardwareAdapter(log_func=self.log)

    # Use the onboard LED (works on Pico and full RPi)
    self.status_led = self.hw.led("LED" if "Pico" in self.hw.model else 13)

    # Log startup info
    self.log(f"Running on: {self.hw.model}")
    self.log(f"Initial CPU temperature: {self.hw.cpu_temperature}°C")

def run(self):
    while self.running:
        # Blink the LED
        self.status_led.value(1)
        time.sleep(0.5)
        self.status_led.value(0)

        # Log temperature every 5 seconds
        self.log(f"CPU temperature: {self.hw.cpu_temp}°C")
        time.sleep(4.5)

if name == "main": SimpleDemo(max_log_files=10).start()

Compatibility

Pico 2 W (MicroPython): Uses machine for pins/PWM. Full RPi (Python): Uses RPi.GPIO and gpiozero for pins/PWM.

Features

RPIApp: Base class for app lifecycle and logging. DeviceManager: Base for hardware managers with logging. LEDSimple: Controls LEDs (on/off/blink). WiFiManager: Manages WiFi connections (Pico only). MotorDriverTB6612FNG: Controls dual DC motors. MicrodotManager: Runs a lightweight web server.

For example applications see projects at www.singerlinks.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpi_app_framework-0.1.4.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpi_app_framework-0.1.4-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file rpi_app_framework-0.1.4.tar.gz.

File metadata

  • Download URL: rpi_app_framework-0.1.4.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for rpi_app_framework-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3d91e93bdbc9ae76105eb50acf5cf9bb8646eca9a47d4b0a342d52744ab9c434
MD5 6ef617f127e8e20aad1e038f8aad74da
BLAKE2b-256 00b4162e9faa3675e354617835a0737a4122f4c6f66a13a4bf4f4512a971789b

See more details on using hashes here.

File details

Details for the file rpi_app_framework-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for rpi_app_framework-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 922ef63bab8a1b02acc85a58c92ddd332941a29b0b911434b751954ce165dfd2
MD5 507e6474782167c27643ee92ccdc6b63
BLAKE2b-256 f4bc2b814f2dbba8fccd05e4162877b1605bcf171056f3a2454b4988950b7144

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page