ClaudeCodeMod

All shelves / Marketplaces

johnlindquist/badger-2350-plugin

johnlindquist/badger-2350-plugin · 8 stars · 1 plugin

Marketplace Complete Claude Code plugin for Universe 2025 (Tufty) Badge development with MonaOS app creation, deployment, and API reference

Install

In Claude Code
/plugin marketplace add johnlindquist/badger-2350-plugin

Run inside Claude Code, then install plugins from it. Check the repo's README before you run it.

Open the repo

Plugins 1

After adding the marketplace, install one with /plugin install <name>@badger-marketplace.

  1. 1badger-2350-devComplete Badger 2350 Badge development environment with skills, commands, and examples/plugin install badger-2350-dev@badger-marketplace

Files

README.md

Badger 2350 Developer Plugin

Version License Platform Claude Code

Complete development environment for Universe 2025 (Tufty) Badge. Create MonaOS apps, manage deployments, and access comprehensive API reference with AI-powered assistance.

Why This Plugin?

Creating apps for the Universe 2025 Badge requires understanding MonaOS structure, badgeware API, deployment workflows, and USB Mass Storage Mode quirks. This plugin bundles everything you need: 5 slash commands, 8 comprehensive skills, example apps, and automated deployment tools.

Immediate Value
  • ⚡ Faster Development: Streamlined workflow from zero to deployed app
  • 📚 Comprehensive Learning: 8 detailed skills cover setup, hardware, API, and troubleshooting
  • 🤖 AI-Powered Help: Claude Code integration with context-aware commands and skills

What's Included

Category What's Included Details
Slash Commands 5 interactive commands Create apps, API lookup, deploy, quickstart, troubleshoot
Skills 8 comprehensive guides 100+ pages of setup, development, API, and troubleshooting
Example Apps 2 working examples Hello World (basic), Meditation Timer (advanced state management)
Utilities 3 helper scripts Installation, pagination, Makefile
Templates 2 ready-to-use App template + 24x24 icon template

Hardware Specifications

┌─────────────────────────────────┐
│   UNIVERSE 2025 TUFTY BADGE     │
├─────────────────────────────────┤
│  RP2350 @ 200MHz (Dual-core)    │
│  320x240 IPS Display (160x120 FB)│
│  512kB SRAM / 16MB Flash        │
│  WiFi 2.4GHz + Bluetooth 5.2    │
│  IR Tx/Rx, 4-zone LED backlight │
│  5 Buttons, 4 GPIO, USB-C       │
│  1000mAh Battery (8+ hours)     │
└─────────────────────────────────┘
Spec Details
CPU RP2350 ARM Cortex-M33 @ 200MHz (dual-core)
Memory 512kB SRAM, 16MB QSPI XiP Flash
Display 320x240 IPS (32-bit color) – 160x120 framebuffer pixel-doubled
Connectivity WiFi 802.11b/g/n (2.4GHz), Bluetooth 5.2
Input 5 buttons (A, B, C, UP, DOWN), IR receiver
Output Full RGB display, 4-zone LED backlight, IR transmitter
Power 1000mAh rechargeable Li-ion (~8 hours typical)
Ports USB-C (power + data), Qw/ST, SWD, 4x GPIO

Installation

Prerequisites
✓ macOS, Linux, or Windows computer
✓ Universe 2025 (Tufty) Badge
✓ USB-C cable (data-capable)
✓ Python 3.8+
✓ Claude Code installed
Quick Install
# In Claude Code
/plugin marketplace add johnlindquist/badger-2350-plugin
/plugin install badger-2350-dev@johnlindquist

Restart Claude Code to activate the plugin.

Verify Installation
# Check commands are available
/help

# Verify environment
/badge-quickstart

Quick Start: Your First App

Step 1: Create App Structure
/create-badge-app my_first_app

Expected Output:

✓ Created my_first_app/
  ├── __init__.py    (template code)
  ├── icon.png       (24x24 placeholder)
  └── assets/        (optional resources)
Step 2: Test Locally
mpremote run my_first_app/__init__.py

Expected Output: Badge display shows "Hello Badge!" with animation

Step 3: Customize Your App
  • Edit my_first_app/__init__.py
  • Add your logic to the update() function
  • Test again with: mpremote run my_first_app/__init__.py
Step 4: Deploy to Badge
/deploy-to-badge my_first_app

Follow the step-by-step USB Mass Storage Mode instructions.

Step 5: Launch from Badge Menu
  1. Press HOME button on badge
  2. Use UP/DOWN to find your app
  3. Press B to launch

🎉 Success! Your custom app is now running on your badge!


Core Concepts

MonaOS App Structure

Every app is a directory in /system/apps/:

my_app/
├── __init__.py           # REQUIRED: Entry point
├── icon.png              # REQUIRED: 24x24 PNG
└── assets/               # OPTIONAL: Resources (auto-loaded)
    └── ...
Required Functions
Function Required? Called Purpose
init() Optional Once on app launch Initialize state, load resources
update() YES Every frame (~30 FPS) Draw frame, handle input, update state
on_exit() Optional On exit to menu Cleanup, save state
Minimal Working App
from badgeware import screen, brushes

def update():
    screen.brush = brushes.color(20, 40, 60)  # RGB
    screen.clear()

    screen.brush = brushes.color(255, 255, 255)
    screen.text("Hello Badge!", 50, 60)
⚠️ CRITICAL: badgeware vs badger2040

This badge uses badgeware (MonaOS), NOT badger2040!

✅ CORRECT for Universe 2025 Badge:

from badgeware import screen, brushes, shapes, io, PixelFont

❌ WRONG (for standard Pimoroni Tufty):

from badger2040 import Badger2040  # DON'T use this!
⚠️ USB Mass Storage Mode is REQUIRED

The /system/apps/ directory is READ-ONLY via mpremote. You MUST use USB Mass Storage Mode to install apps:

How to Enter:

  1. Press RESET button TWICE quickly (double-click)
  2. Badge appears as "BADGER" drive
  3. Copy your app folder to BADGER/apps/
  4. Eject drive and press RESET once

Slash Commands Reference

1. /create-badge-app <name>

Scaffold a new MonaOS app with template code, icon, and structure.

Usage:

/create-badge-app weather_app
/create-badge-app led_controller

What it creates:

  • app_name/__init__.py - Boilerplate with comments
  • app_name/icon.png - 24x24 placeholder
  • app_name/assets/ - Empty directory

2. /badgeware-api [search]

Quick API reference for the badgeware module.

Usage:

/badgeware-api                 # Show complete API
/badgeware-api button          # Find button-related functions
/badgeware-api animation       # Animation examples

3. /deploy-to-badge <app>

Step-by-step deployment via USB Mass Storage Mode.

Usage:

/deploy-to-badge my_app

Provides OS-specific copy commands and verification steps.


4. /badge-quickstart

Verify your development environment is properly configured.

Usage:

/badge-quickstart

Checks Python, mpremote, badge connection, and badgeware module.


5. /troubleshoot [issue]

Diagnostic guide for common problems.

Usage:

/troubleshoot badge-not-detected
/troubleshoot memory-error

8 Comprehensive Skills

Ask Claude Code to use any skill for detailed help:

Skill When to Use
badger-quickstart Getting started, first-time setup, "where do I begin?"
python-setup Python installation issues, virtual environments
badger-2350-dev Development workflows, toolchain setup
badger-app-creator Building apps, graphics, animations
badger-hardware GPIO, sensors, I2C/SPI, IR, LED backlight
micropython-repl Interactive testing, package management
badger-deploy Installing apps, multi-file projects
badger-diagnostics Troubleshooting, system verification

Example Apps

Hello World (Basic)

Difficulty: Beginner

Features:

  • Animated colored circle
  • Color cycling
  • Button handling (all 5 buttons)
mpremote run examples/hello_world/__init__.py
Meditation Timer (Advanced)

Difficulty: Advanced

Features:

  • State machine architecture
  • Duration selection (1-30 minutes)
  • Breathing animation (4-second cycle)
  • Pause/resume functionality
  • Completion screen
mpremote run examples/meditation_timer/__init__.py

Common Patterns

Simple Counter (State Management)
counter = 0

def update():
    global counter

    screen.brush = brushes.color(0, 0, 0)
    screen.clear()

    screen.brush = brushes.color(255, 255, 255)
    screen.text(f"Count: {counter}", 30, 60)

    if io.BUTTON_A in io.pressed:
        counter += 1
Animation (Sine Wave)
import math

def update():
    offset = int(math.sin(io.ticks / 50) * 20)
    x = 80 + offset

    screen.brush = brushes.color(255, 100, 100)
    screen.draw(shapes.circle(x, 60, 15))
Data Persistence (Save/Load)
import json

def load_state():
    try:
        with open("/storage/app_state.json", "r") as f:
            return json.load(f)
    except:
        return {"level": 1, "score": 0}

def save_state(state):
    with open("/storage/app_state.json", "w") as f:
        json.dump(state, f)

Button Reference

from badgeware import io

# Check button states in update()
if io.BUTTON_A in io.pressed:    # Just pressed
if io.BUTTON_B in io.released:   # Just released
if io.BUTTON_C in io.held:       # Currently held
if io.BUTTON_UP in io.changed:   # State changed

Available buttons:

  • io.BUTTON_A, io.BUTTON_B, io.BUTTON_C
  • io.BUTTON_UP, io.BUTTON_DOWN
  • io.BUTTON_HOME (exits to menu - auto-handled)

API Quick Reference

Display
from badgeware import screen, brushes, shapes

# Clear screen
screen.brush = brushes.color(20, 40, 60)
screen.clear()

# Draw text
screen.text("Hello", 50, 60)

# Draw shapes
screen.draw(shapes.circle(80, 60, 20))
screen.draw(shapes.rectangle(10, 10, 100, 50))
Animation
# Frame counter
io.ticks  # Increments each update

# Usage
angle = (io.ticks / 50) * 2 * math.pi
y = 60 + int(math.sin(angle) * 20)
Images & Fonts
# Load and display image
img = Image.load("sprite.png")
screen.blit(img, x, y)

# Load custom font
screen.font = PixelFont.load("font.ppf")

Troubleshooting

Badge not detected?
  1. Check USB cable is data-capable (not charge-only)
  2. Try different USB port
  3. Press RESET button on badge
  4. Run /badge-quickstart to diagnose
App doesn't appear in menu?
  1. Verify you used USB Mass Storage Mode (not mpremote)
  2. Check files exist: __init__.py and icon.png
  3. If you have 7+ apps, install paginated menu
  4. Run /troubleshoot app-not-in-menu
Memory errors?
  1. Call gc.collect() periodically
  2. Load resources once in init(), not in update()
  3. Use smaller images
  4. Delete unused variables

FAQ

Q: Do I need to be a programmer? A: No! The quickstart guide teaches basics as you go.

Q: How do I get started? A: Follow the Quick Start guide above to create and deploy your first app.

Q: Can I use my Pimoroni Tufty 2040? A: No, this is specifically for Universe 2025 Badge (different firmware).

Q: Can I create games? A: Absolutely! Display updates at ~30 FPS.

Q: Why can't I use mpremote cp to install apps? A: Because /system/apps/ is read-only. USB Mass Storage Mode required.

Q: Can I have unlimited apps? A: Yes, but install menu_paginated.py to show more than 6.


Common Workflows

Create → Test → Deploy
# 1. Create app
/create-badge-app weather_app

# 2. Edit and test
mpremote run weather_app/__init__.py

# 3. Deploy
/deploy-to-badge weather_app
Update Existing App
# 1. Edit locally
vim my_app/__init__.py

# 2. Test
mpremote run my_app/__init__.py

# 3. Update via Mass Storage Mode
# Press RESET twice
# Replace files in /Volumes/BADGER/apps/my_app/
# Eject and press RESET once

Utility Scripts

install_to_badge.sh

One-command deployment via USB Mass Storage Mode.

./install_to_badge.sh my_app
menu_paginated.py

Support more than 6 apps in MonaOS launcher.

# Copy to badge in Mass Storage Mode
cp menu_paginated.py /Volumes/BADGER/apps/menu/__init__.py
Makefile

Development shortcuts for common commands.

make setup    # Install dependencies
make test     # Test connection
make repl     # Connect to REPL
make run FILE=app.py  # Run script temporarily

Official Resources

Badge Documentation
API Reference
MicroPython

Contributing

Report Issues

Submit issues: https://github.com/johnlindquist/badger-2350-plugin/issues

Share Your Apps

Check https://badger.github.io/apps/ for submission guidelines.

Improve This Plugin

PRs welcome at: https://github.com/johnlindquist/badger-2350-plugin


License

MIT License - See LICENSE file for details.

Credits

  • Created for GitHub Universe 2025 Badge developer community
  • Pimoroni Ltd. for original Tufty 2350 hardware
  • Official badge repository: https://github.com/badger/home
  • MicroPython community and documentation

Support

For detailed help on any topic, use the included skills:

  • Ask Claude Code to use badger-quickstart skill
  • Ask Claude Code to use badger-diagnostics skill
  • Ask Claude Code to use badger-app-creator skill

Happy badge hacking! 🦡

Plugin Version: 1.0.0 Last Updated: October 2025


Quick Links

Facts

Kind
Marketplace
Repo
johnlindquist/badger-2350-plugin
Group
Uncategorized
Stars
8
Marketplace name
badger-marketplace
Owner
Badge Developer
Language
Python
Created
2025-10-30
Last push
2025-10-30
Forks
1
Plugins
1

From the same owner

  1. 1648johnlindquist/claude-pluginsjohnlindquist/claude-plugins2